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

SOPS 3.9.0: use encrypt/decrypt subcommands, use --filename-override option for encryption, use filestatus to check for encrypted files #190

Merged
merged 5 commits into from
Jul 7, 2024

Conversation

felixfontein
Copy link
Collaborator

@felixfontein felixfontein commented Jul 4, 2024

Motivation

Use new features of SOPS 3.9.0 to improve various things in this collection.

Changes description

Copy link

github-actions bot commented Jul 4, 2024

Docs Build 📝

Thank you for contribution!✨

This PR has been merged and the docs are now incorporated into main:
https://ansible-collections.github.io/community.sops/branch/main

@felixfontein felixfontein force-pushed the improvements branch 2 times, most recently from 944b5a9 to e9b2c3b Compare July 4, 2024 20:17
@felixfontein felixfontein changed the title [WIP] SOPS 3.9.0: use encrypt/decrypt subcommands, use --filename-override option for encryption SOPS 3.9.0: use encrypt/decrypt subcommands, use --filename-override option for encryption Jul 6, 2024
@felixfontein felixfontein marked this pull request as ready for review July 6, 2024 20:36
@felixfontein felixfontein changed the title SOPS 3.9.0: use encrypt/decrypt subcommands, use --filename-override option for encryption SOPS 3.9.0: use encrypt/decrypt subcommands, use --filename-override option for encryption, use filestatus to check for encrypted files Jul 6, 2024
@felixfontein
Copy link
Collaborator Author

This is now ready for review! 🎉

Copy link
Collaborator

@endorama endorama left a comment

Choose a reason for hiding this comment

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

Left a nitpick, looks great to me!

else:
self._warn('Cannot extract SOPS version from: %s' % repr(output))
else:
self._debug('Cannot detect SOPS version efficiently, likely a version before 3.8.0')
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd suggest to remove efficiently as it suggest that some form of version detection happened, which is not the case.

Suggested change
self._debug('Cannot detect SOPS version efficiently, likely a version before 3.8.0')
self._debug('Cannot detect SOPS version, likely a version before 3.8.0')

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Actually efficicently is the whole point here: only 3.8.0 and later allow to disable the network request done when calling sops --version, which makes sops --version rather slow (0.3-0.7 seconds vs. 0.01-0.03 seconds runtime for 3.9.0, not sure how slow it is with older versions, since the way the version check worked changed over time).

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thank you for the clarification! So that cli flag avoids the roundtrip speeding up the command. Let's merge this! 👍

@felixfontein felixfontein merged commit ed0318a into ansible-collections:main Jul 7, 2024
65 checks passed
@felixfontein felixfontein deleted the improvements branch July 7, 2024 17:36
@felixfontein
Copy link
Collaborator Author

@endorama thanks for reviewing this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

If .sops.yaml contains a path_regex sops_encrypt doesn't work
2 participants