-
Notifications
You must be signed in to change notification settings - Fork 398
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Python and Glue version parameters, add check mode #480
Add Python and Glue version parameters, add check mode #480
Conversation
Looks like the tests fail with the following IAM permissions error:
This appears to depend on this PR. What's the best way to move it forward? |
Looking at mattclay/aws-terminator#95 the best bet would be to open a fresh PR. The 'testing' (JSON) policy shouldn't be needed any more as the 'testing' policies now automatically include the core CI policies. @jillr usually reviews the aws-terminator PRs on Thursday afternoons (US time), so if you can get it pushed in the next 36 hours or so there's a good chance it can be merged quickly. |
@tremble Thank you. I submitted mattclay/aws-terminator#137. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because this is a pre-existing module I'd recommend not setting a default for either of these parameters and letting AWS set the defaults. This avoids the potential for the 'default' versions to change between Ansible/Collection versions in a way which may break someone's playbooks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tested the IAM policies up through line 175 in the integration test file but I'm running into multiple assertion failures.
- glue_job.changed | ||
- glue_job.command.python_version == job_info["Job"]["Command"]["PythonVersion"] | ||
- glue_job.command.script_location == job_info["Job"]["Command"]["ScriptLocation"] | ||
- glue_job.default_arguments == job_info["Job"]["DefaultArguments"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This assertion is failing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect this is because camel_dict_to_snake_dict
converts DefaultArguments
to snake_case.
I added DefaultArguments
to the exclusion list for camel_dict_to_snake_dict
. I believe this resolves the assertion failure.
assert: | ||
that: | ||
- glue_job_check.changed | ||
- not glue_job_check.description |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no description
key being returned, if this is what you want to test for it would need to be:
- '"description" not in glue_job_check'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jillr I fixed the test syntax (I think).
- job_info["Job"]["Description"] == job_info_idempotent["Job"]["Description"] | ||
- job_info["Job"]["GlueVersion"] == job_info_idempotent["Job"]["GlueVersion"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both of these assertions are failing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jillr I believe this is due to the same reason as assertion in line 90.
@ichekaldin this PR contains the following merge commits: Please rebase your branch to remove these commits. |
@ichekaldin this PR contains the following merge commits: Please rebase your branch to remove these commits. |
@ichekaldin this PR contains the following merge commits: Please rebase your branch to remove these commits. |
@jillr Is there anything else I could do to move this forward? |
@ichekaldin Some of the tests are still failing, I was able to comment out enough to get the policies tested though and will deploy those to our production CI. It's helpful to reviewers if we have passing tests to verify changes with.
|
@jillr It looks like the tests are passing now. Can this be approved? |
Available Python and Glue version can be found here: https://docs.aws.amazon.com/glue/latest/dg/add-job.html Example: ``` community.aws.aws_glue__jobs: - name: my-job description: My test job command_script_location: my-s3-bucket/script.py command_python_version: 3 glue_version: "2.0" role: MyGlueJobRole state: present ```
This is to avoid inadvertently breaking existing playbooks. Defaults will be set by AWS.
Reference: https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/ Remove duplicate import.
Add tests for DefaultArguments.
Use `get_aws_account_info` method to determine AWS partition and accunt ID instead of reinventing the wheel. Rearrange module attributes alphabetically.
recheck |
@tremble Is there any more work that needs to happen with this PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
inventory_aws_ec2/test: switch to ec2_instance SUMMARY Migrate the inventory_aws_ec2 tests from ec2 to ec2_instance. Also, properly clean up all the resources during the test ISSUE TYPE Bugfix Pull Request COMPONENT NAME inventory_aws_ec2 Reviewed-by: Mark Chappell <None> Reviewed-by: Gonéri Le Bouder <goneri@lebouder.net> Reviewed-by: None <None>
do not include {} boto filter by default Depends-On: ansible-collections#480 When no filter: specified, do not include an empty dict in the list of boto filters because it effectively matches any host. Closes: ansible-collections#457 Closes: ansible-collections#452 ISSUE TYPE Bugfix Pull Request Reviewed-by: Mark Chappell <None> Reviewed-by: Alina Buzachis <None> Reviewed-by: None <None>
SUMMARY
Add parameters for Python version and Glue version.
Available Python and Glue version can be found here:
https://docs.aws.amazon.com/glue/latest/dg/add-job.html
ISSUE TYPE
COMPONENT NAME
aws_glue_job
ADDITIONAL INFORMATION
Example: