Skip to content
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

aws_codebuild - Add resource_tags parameter and deprecate tags #1221

Conversation

tremble
Copy link
Contributor

@tremble tremble commented Jun 6, 2022

SUMMARY

aws_codebuild currently uses the boto3 style 'list of dictionaries' format rather than the usual dictionary format.

  • Add a resource_tags parameter that accepts the usual dictionary format
  • Add the purge_tags parameter
  • deprecate the tags parameter in preparation for switching it to the usual dict format
  • expand integration tests for tags and description
  • make source and artifacts optional unless creating a new project
  • fix bug with inconsistent "changed" state due to tag order not being guaranteed
ISSUE TYPE
  • Bugfix Pull Request
  • Feature Pull Request
COMPONENT NAME

aws_codebuild

ADDITIONAL INFORMATION

The (boto3) tags format in the return value when describing a project makes no guarantees about the order it'll return the key/value pairs. As such, when multiple tags were set the naïve original == new comparison would sporadically return "changed" when no change had occurred.

@github-actions
Copy link

github-actions bot commented Jun 6, 2022

Docs Build 📝

Thank you for contribution!✨

This PR has been merged and your docs changes will be incorporated when they are next published.

@ansibullbot
Copy link

@ansibullbot ansibullbot added bug This issue/PR relates to a bug community_review integration tests/integration module module needs_triage plugins plugin (any type) tests tests labels Jun 6, 2022
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

ansible-galaxy-importer FAILURE in 3m 36s (non-voting)
✔️ build-ansible-collection SUCCESS in 4m 44s
✔️ ansible-test-sanity-docker-devel SUCCESS in 12m 14s (non-voting)
✔️ ansible-test-sanity-docker-milestone SUCCESS in 9m 56s
✔️ ansible-test-sanity-docker-stable-2.9 SUCCESS in 11m 54s
✔️ ansible-test-sanity-docker-stable-2.11 SUCCESS in 9m 35s
✔️ ansible-test-sanity-docker-stable-2.12 SUCCESS in 9m 38s
✔️ ansible-test-units-community-aws-python38 SUCCESS in 6m 09s
✔️ ansible-test-units-community-aws-python39 SUCCESS in 5m 40s
✔️ ansible-test-splitter SUCCESS in 2m 26s
✔️ integration-community.aws-1 SUCCESS in 6m 00s
⚠️ integration-community.aws-2 SKIPPED
⚠️ integration-community.aws-3 SKIPPED
⚠️ integration-community.aws-4 SKIPPED
⚠️ integration-community.aws-5 SKIPPED
⚠️ integration-community.aws-6 SKIPPED
⚠️ integration-community.aws-7 SKIPPED
⚠️ integration-community.aws-8 SKIPPED
⚠️ integration-community.aws-9 SKIPPED
⚠️ integration-community.aws-10 SKIPPED
⚠️ integration-community.aws-11 SKIPPED
⚠️ integration-community.aws-12 SKIPPED
⚠️ integration-community.aws-13 SKIPPED

@jatorcasso
Copy link
Contributor

@tremble does it make sense to split the bugfix into a separate PR so we can backport to stable-2? then backport this to stable-3?

@tremble
Copy link
Contributor Author

tremble commented Jun 6, 2022

I don't think there's a 'breaking' change in here, so at least in theory we can backport the whole thing to stable-3

@jatorcasso jatorcasso added backport-2 PR should be backported to the stable-2 branch backport-3 PR should be backported to the stable-3 branch labels Jun 6, 2022
Copy link
Contributor

@jatorcasso jatorcasso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - left some small typo fixes

changelogs/fragments/1221-aws_codebuild-tagging.yml Outdated Show resolved Hide resolved
changelogs/fragments/1221-aws_codebuild-tagging.yml Outdated Show resolved Hide resolved
changelogs/fragments/1221-aws_codebuild-tagging.yml Outdated Show resolved Hide resolved
plugins/modules/aws_codebuild.py Outdated Show resolved Hide resolved
Co-authored-by: Joseph Torcasso <[email protected]>
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

ansible-galaxy-importer FAILURE in 4m 54s (non-voting)
✔️ build-ansible-collection SUCCESS in 4m 55s
✔️ ansible-test-sanity-docker-devel SUCCESS in 10m 07s (non-voting)
✔️ ansible-test-sanity-docker-milestone SUCCESS in 10m 06s
✔️ ansible-test-sanity-docker-stable-2.9 SUCCESS in 12m 52s
✔️ ansible-test-sanity-docker-stable-2.11 SUCCESS in 10m 55s
✔️ ansible-test-sanity-docker-stable-2.12 SUCCESS in 10m 22s
✔️ ansible-test-units-community-aws-python38 SUCCESS in 7m 53s
✔️ ansible-test-units-community-aws-python39 SUCCESS in 6m 43s
✔️ ansible-test-splitter SUCCESS in 2m 44s
✔️ integration-community.aws-1 SUCCESS in 7m 19s
⚠️ integration-community.aws-2 SKIPPED
⚠️ integration-community.aws-3 SKIPPED
⚠️ integration-community.aws-4 SKIPPED
⚠️ integration-community.aws-5 SKIPPED
⚠️ integration-community.aws-6 SKIPPED
⚠️ integration-community.aws-7 SKIPPED
⚠️ integration-community.aws-8 SKIPPED
⚠️ integration-community.aws-9 SKIPPED
⚠️ integration-community.aws-10 SKIPPED
⚠️ integration-community.aws-11 SKIPPED
⚠️ integration-community.aws-12 SKIPPED
⚠️ integration-community.aws-13 SKIPPED

@tremble tremble added the mergeit Merge the PR (SoftwareFactory) label Jun 7, 2022
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded (gate pipeline).

ansible-galaxy-importer FAILURE in 4m 31s (non-voting)
✔️ build-ansible-collection SUCCESS in 4m 42s
✔️ ansible-test-sanity-docker-devel SUCCESS in 10m 21s (non-voting)
✔️ ansible-test-sanity-docker-milestone SUCCESS in 10m 18s
✔️ ansible-test-sanity-docker-stable-2.9 SUCCESS in 13m 25s
✔️ ansible-test-sanity-docker-stable-2.11 SUCCESS in 9m 51s
✔️ ansible-test-sanity-docker-stable-2.12 SUCCESS in 10m 28s
✔️ ansible-test-units-community-aws-python38 SUCCESS in 6m 27s
✔️ ansible-test-units-community-aws-python39 SUCCESS in 5m 21s
✔️ ansible-test-splitter SUCCESS in 2m 20s
✔️ integration-community.aws-1 SUCCESS in 5m 56s
⚠️ integration-community.aws-2 SKIPPED
⚠️ integration-community.aws-3 SKIPPED
⚠️ integration-community.aws-4 SKIPPED
⚠️ integration-community.aws-5 SKIPPED
⚠️ integration-community.aws-6 SKIPPED
⚠️ integration-community.aws-7 SKIPPED
⚠️ integration-community.aws-8 SKIPPED
⚠️ integration-community.aws-9 SKIPPED
⚠️ integration-community.aws-10 SKIPPED
⚠️ integration-community.aws-11 SKIPPED
⚠️ integration-community.aws-12 SKIPPED
⚠️ integration-community.aws-13 SKIPPED

@softwarefactory-project-zuul softwarefactory-project-zuul bot merged commit 20f2afd into ansible-collections:main Jun 7, 2022
@patchback
Copy link

patchback bot commented Jun 7, 2022

Backport to stable-2: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-2/20f2afd75e506d90a72fb27e4cba3bb09f707494/pr-1221

Backported as #1223

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request Jun 7, 2022
aws_codebuild - Add resource_tags parameter and deprecate tags

SUMMARY
aws_codebuild currently uses the boto3 style 'list of dictionaries' format rather than the usual dictionary format.

Add a resource_tags parameter that accepts the usual dictionary format
Add the purge_tags parameter
deprecate the tags parameter in preparation for switching it to the usual dict format
expand integration tests for tags and description
make source and artifacts optional unless creating a new project
fix bug with inconsistent "changed" state due to tag order not being guaranteed

ISSUE TYPE

Bugfix Pull Request
Feature Pull Request

COMPONENT NAME
aws_codebuild
ADDITIONAL INFORMATION
The (boto3) tags format in the return value when describing a project makes no guarantees about the order it'll return the key/value pairs.  As such, when multiple tags were set the naïve original == new comparison would sporadically return "changed" when no change had occurred.

Reviewed-by: Joseph Torcasso <None>
Reviewed-by: Mark Chappell <None>
(cherry picked from commit 20f2afd)
@patchback
Copy link

patchback bot commented Jun 7, 2022

Backport to stable-3: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-3/20f2afd75e506d90a72fb27e4cba3bb09f707494/pr-1221

Backported as #1224

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request Jun 7, 2022
aws_codebuild - Add resource_tags parameter and deprecate tags

SUMMARY
aws_codebuild currently uses the boto3 style 'list of dictionaries' format rather than the usual dictionary format.

Add a resource_tags parameter that accepts the usual dictionary format
Add the purge_tags parameter
deprecate the tags parameter in preparation for switching it to the usual dict format
expand integration tests for tags and description
make source and artifacts optional unless creating a new project
fix bug with inconsistent "changed" state due to tag order not being guaranteed

ISSUE TYPE

Bugfix Pull Request
Feature Pull Request

COMPONENT NAME
aws_codebuild
ADDITIONAL INFORMATION
The (boto3) tags format in the return value when describing a project makes no guarantees about the order it'll return the key/value pairs.  As such, when multiple tags were set the naïve original == new comparison would sporadically return "changed" when no change had occurred.

Reviewed-by: Joseph Torcasso <None>
Reviewed-by: Mark Chappell <None>
(cherry picked from commit 20f2afd)
tremble added a commit that referenced this pull request Jun 7, 2022
…eprecate tags (#1221)

fix bug with inconsistent "changed" state due to tag order not being guaranteed

ISSUE TYPE

Bugfix Pull Request
Feature Pull Request

COMPONENT NAME
aws_codebuild
ADDITIONAL INFORMATION
The (boto3) tags format in the return value when describing a project makes no guarantees about the order it'll return the key/value pairs.  As such, when multiple tags were set the naïve original == new comparison would sporadically return "changed" when no change had occurred.

Reviewed-by: Joseph Torcasso <None>
Reviewed-by: Mark Chappell <None>
(cherry picked from commit 20f2afd)
softwarefactory-project-zuul bot pushed a commit that referenced this pull request Jun 7, 2022
#1224)

[PR #1221/20f2afd7 backport][stable-3] aws_codebuild - Add resource_tags parameter and deprecate tags

This is a backport of PR #1221 as merged into main (20f2afd).
SUMMARY
aws_codebuild currently uses the boto3 style 'list of dictionaries' format rather than the usual dictionary format.

Add a resource_tags parameter that accepts the usual dictionary format
Add the purge_tags parameter
deprecate the tags parameter in preparation for switching it to the usual dict format
expand integration tests for tags and description
make source and artifacts optional unless creating a new project
fix bug with inconsistent "changed" state due to tag order not being guaranteed

ISSUE TYPE

Bugfix Pull Request
Feature Pull Request

COMPONENT NAME
aws_codebuild
ADDITIONAL INFORMATION
The (boto3) tags format in the return value when describing a project makes no guarantees about the order it'll return the key/value pairs.  As such, when multiple tags were set the naïve original == new comparison would sporadically return "changed" when no change had occurred.

Reviewed-by: Alina Buzachis <None>
Reviewed-by: Markus Bergholz <[email protected]>
Reviewed-by: Mark Chappell <None>
@tremble tremble deleted the tagging/aws_codebuild branch July 7, 2022 19:23
softwarefactory-project-zuul bot pushed a commit that referenced this pull request Jan 11, 2023
… list of dicts (#1643)

[6.0.0] codebuild_project - update tags param to use dict rather than list of dicts

SUMMARY
Passing list of dicts was deprecated, move it to dict
fixes: #1546
Originally deprecated in #1221 as part of the tagging cleanup.
ISSUE TYPE

Feature Pull Request

COMPONENT NAME
codebuild_project
ADDITIONAL INFORMATION

Reviewed-by: Alina Buzachis <None>
abikouo pushed a commit to abikouo/community.aws that referenced this pull request Oct 24, 2023
ec2_security_group - refacter get_target_from_rule()

SUMMARY
refacter get_target_from_rule to bring down the complexity score
Builds on top of ansible-collections#1214
ISSUE TYPE

Feature Pull Request

COMPONENT NAME
ec2_security_group
ADDITIONAL INFORMATION

Reviewed-by: Alina Buzachis <None>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-2 PR should be backported to the stable-2 branch backport-3 PR should be backported to the stable-3 branch bug This issue/PR relates to a bug community_review integration tests/integration mergeit Merge the PR (SoftwareFactory) module module needs_triage plugins plugin (any type) tests tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants