Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Contributing to AWS CLI v1-to-v2 Migration Tool

Contribution guidelines for the AWS CLI v1-to-v2 Migration Tool.

## Development Setup

### Installing development versions

If you are interested in using the latest released version of the AWS CLI v1-to-v2 Migration Tool, please see the [Installation](https://github.com/aws/aws-cli/blob/v1v2-migration-tool/README.md#installation) section in the README.
This section is for anyone who wants to install the development version of the AWS CLI v1-to-v2 Migration Tool. You might need to do this if:

* You are developing a feature for the AWS CLI v1-to-v2 Migration Tool and plan on submitting a Pull Request.
* You want to test the latest changes of the AWS CLI v1-to-v2 Migration Tool before they make it into an official release.

Install [uv](https://docs.astral.sh/uv/) if you haven't already, then set up the development environment:

```bash
uv sync --extra dev
```

This will create a virtual environment, install all dependencies, and install the package in development mode.

Activate the virtual environment:
```bash
source .venv/bin/activate
```

### Running the CLI
```bash
migrate-aws-cli --script <script.sh>
```

### Running tests
```bash
uv run pytest tests/ -v
```

### Code formatting
```bash
uv run ruff format aws_cli_migrate tests
uv run ruff check --select I --fix aws_cli_migrate tests
```

### Code linting
```bash
uv run ruff format --check aws_cli_migrate tests
uv run ruff check aws_cli_migrate tests
```

### Clean local workspace
```bash
rm -rf .venv build dist *.egg-info
find . -type d -name __pycache__ -exec rm -rf {} +
find . -type f -name "*.pyc" -delete
```

## Submitting Changes

When you're ready to submit your changes:

1. Ensure all tests pass
2. Ensure code formatting and linting checks pass
3. Submit a Pull Request with a clear description of your changes

## Getting Help

The best way to interact with our team is through GitHub. You can [open an issue](https://github.com/aws/aws-cli/issues/new?template=migration-tool.yml) and choose the templates for the AWS CLI v1-to-v2 Migration Tool.
100 changes: 50 additions & 50 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ Jump to:

* [Installation](#installation)
* [Usage](#usage)
* [Development](#development)
* [Supported Breaking Changes](#supported-breaking-changes)
* [Backwards Compatibility Policy](#backwards-compatibility-policy)
* [Contributing](#contributing)
* [Getting Help](#getting-help)

## Installation
Expand Down Expand Up @@ -42,8 +44,6 @@ $ python3 -m pip install --upgrade aws-cli-migrate

This will install the `aws-cli-migrate` package as well as all dependencies.

If you want to run `aws-cli-migrate` from source, see the [Installing development versions](#installing-development-versions) section.

## Usage

### Dry-run mode (default)
Expand All @@ -52,19 +52,23 @@ Display issues without modifying the script:
migrate-aws-cli --script upload_s3_files.sh
```

### Fix mode

### Auto-fix mode

Automatically update the input script:

```bash
migrate-aws-cli --script upload_s3_files.sh --fix
```

### Output mode
Create a new fixed script without modifying the original:
Optionally, supply an output path to write the updated script, rather than updating the
input bash script:
```bash
migrate-aws-cli --script upload_s3_files.sh --output upload_s3_files_v2.sh
migrate-aws-cli --script upload_s3_files.sh --output upload_s3_files_v2.sh --fix
```

### Interactive mode

Review and accept/reject each change individually:
```bash
migrate-aws-cli --script upload_s3_files.sh --interactive --output upload_s3_files_v2.sh
Expand All @@ -73,65 +77,61 @@ migrate-aws-cli --script upload_s3_files.sh --interactive --output upload_s3_fil
In interactive mode, you can:
- Press `y` to accept the current change
- Press `n` to skip the current change
- Press `a` to accept all findings with the current type
- Press `r` to reject all findings with the current type
- Press `u` to accept all remaining changes
- Press `s` to save and exit
- Press `q` to quit without saving

## Development

### Installing development versions
## Supported Breaking Changes

If you are interested in using the latest released version of the AWS CLI v1-to-v2 Migration Tool, please see the [Installation](#installation) section.
This section is for anyone who wants to install the development version of the AWS CLI v1-to-v2 Migration Tool. You might need to do this if:
The AWS CLI v1-to-v2 Migration Tool lints bash scripts for usage
of AWS CLI v1 commands that are likely to face breaking changes after upgrading to AWS CLI v2.
Additionally, the migration tool can automatically modify bash scripts to prevent breakage caused
by breaking changes that would be caused by upgrading to AWS CLI v2.

* You are developing a feature for the AWS CLI v1-to-v2 Migration Tool and plan on submitting a Pull Request.
* You want to test the latest changes of the AWS CLI v1-to-v2 Migration Tool before they make it into an official release.
Using the migration tool does not guarantee that all breaking changes will be fully prevented. We recommend
that users upgrading from AWS CLI v1 to AWS CLI v2 read
[Breaking changes between AWS CLI version 1 and AWS CLI version 2](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration-changes.html#cliv2-migration-changes-breaking)
in [New features and changes in the AWS CLI version 2](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration-changes.html).

Install [uv](https://docs.astral.sh/uv/) if you haven't already, then set up the development environment:
The table below describes which breaking changes the migration tool can detect or automatically
fix.

```bash
uv sync --extra dev
```

This will create a virtual environment, install all dependencies, and install the package in development mode.

Activate the virtual environment:
```bash
source .venv/bin/activate
```
| Breaking Change | Detection | Auto-fix |
|----------------|-----------|----------|
| [Environment variable added to set text file encoding](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration-changes.html#cliv2-migration-encodingenvvar) | ❌ No | ❌ No |
| [Binary parameters are passed as base64-encoded strings by default](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration-changes.html#cliv2-migration-binaryparam) | ✅ Yes | ✅ Yes |
| [Improved Amazon S3 handling of file properties and tags for multipart copies](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration-changes.html#cliv2-migration-s3-copy-metadata) | ✅ Yes | ✅ Yes |
| [No automatic retrieval of http:// or https:// URLs for parameters](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration-changes.html#cliv2-migration-paramfile) | ❌ No | ❌ No |
| [Pager used for all output by default](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration-changes.html#cliv2-migration-output-pager) | ✅ Yes | ✅ Yes |
| [Timestamp output values are standardized to ISO 8601 format](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration-changes.html#cliv2-migration-timestamp) | ❌ No | ❌ No |
| [Improved handling of CloudFormation deployments that result in no changes](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration-changes.html#cliv2-migration-cfn) | ✅ Yes | ✅ Yes |
| [Changed default behavior for Regional Amazon S3 endpoint for us-east-1 Region](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration-changes.html#cliv2-migration-s3-regional-endpoint) | ❌ No | ❌ No |
| [Changed default behavior for Regional AWS STS endpoints](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration-changes.html#cliv2-migration-sts-regional-endpoint) | ❌ No | ❌ No |
| [ecr get-login removed and replaced with ecr get-login-password](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration-changes.html#cliv2-migration-ecr-get-login) | ✅ Yes | ❌ No |
| [AWS CLI version 2 support for plugins is changing](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration-changes.html#cliv2-migration-profile-plugins) | ❌ No | ❌ No |
| [Hidden alias support removed](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration-changes.html#cliv2-migration-aliases) | ✅ Yes | ✅ Yes |
| [The api_versions configuration file setting is not supported](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration-changes.html#cliv2-migration-api-versions) | ❌ No | ❌ No |
| [AWS CLI version 2 uses only Signature v4 to authenticate Amazon S3 requests](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration-changes.html#cliv2-migration-sigv4) | ❌ No | ❌ No |
| [AWS CLI version 2 is more consistent with paging parameters](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration-changes.html#cliv2-migration-skeleton-paging) | ✅ Yes | ❌ No |
| [AWS CLI version 2 provides more consistent return codes across all commands](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration-changes.html#cliv2-migration-return-codes) | ❌ No | ❌ No |

### Running the CLI
```bash
migrate-aws-cli --script <script.sh>
```
## Backwards Compatibility Policy

### Running tests
```bash
uv run pytest tests/ -v
```
The AWS CLI v1-to-v2 Migration Tool does not guarantee backwards compatibility. In particular,
this tool may face breaking changes in any future versions.

### Code formatting
```bash
uv run ruff format aws_cli_migrate tests
uv run ruff check --select I --fix aws_cli_migrate tests
```
See [CHANGELOG.md](https://github.com/aws/aws-cli/blob/v1v2-migration-tool/CHANGELOG.md) for details on the changes introduced in each update of the AWS CLI v1-to-v2
Migration Tool.

### Code linting
```bash
uv run ruff format --check aws_cli_migrate tests
uv run ruff check aws_cli_migrate tests
```
## Contributing

### Clean local workspace
```bash
rm -rf .venv build dist *.egg-info
find . -type d -name __pycache__ -exec rm -rf {} +
find . -type f -name "*.pyc" -delete
```
If you'd like to contribute to the project, please see our [Contributing Guide](https://github.com/aws/aws-cli/blob/v1v2-migration-tool/CONTRIBUTING.md) for development setup instructions and guidelines.

## Getting Help

The best way to interact with our team is through GitHub. You can [open an issue](https://github.com/aws/aws-cli/issues/new/choose) and choose the templates for the AWS CLI v1-to-v2 Migration Tool.
The best way to interact with our team is through GitHub. You can [open an issue](https://github.com/aws/aws-cli/issues/new?template=migration-tool.yml) and choose the templates for the AWS CLI v1-to-v2 Migration Tool.

If you have a support plan with AWS Support, you can also create a new support case.

Expand Down
Loading