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

Include SHA1 hash when deleting a file #144

Merged
merged 4 commits into from
Jun 28, 2024

Conversation

christianwaldmann
Copy link
Contributor

@christianwaldmann christianwaldmann commented Jun 26, 2024

What does this PR do?

  • This adds the CLI option --display-format to customize the printed message when deleting a file
  • This PR adds the SHA1 hash to the output when deleting a file
  • Fixes a slight inconsistency between the formatting when deleting a file in dry mode vs. destroy mode

Motivation

  • This information (SHA1 hash) can be helpful for recovering accidentally deleted files later on, as Artifactory uses Checksum-based Storage.

More

  • Added tests

Copy link
Member

@allburov allburov left a comment

Choose a reason for hiding this comment

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

Let's add it by default if there's sha1 from artifactory!

That would be useful for "export data" as well

@christianwaldmann
Copy link
Contributor Author

Changed the default to include the sha1 hash.

I'm not sure what you mean by "export data", because the option --output is only printing the summary and not the deleted files. Therefore a hash doesn't make sense there.

@allburov
Copy link
Member

Changed the default to include the sha1 hash.

Oh, sorry, I meant only that, without any additional changes.

I don't see the point of having flex format if we manually replace it later.

--output is only printing the summary and not the deleted files. Therefore a hash doesn't make sense there.

I thought it was merged already, but it's not. Never mind!
#136

@christianwaldmann christianwaldmann changed the title Add CLI option --display-format Include SHA1 hash when deleting a file Jun 28, 2024
@christianwaldmann
Copy link
Contributor Author

Got it, a fixed format including the hash works fine for me too.

I updated the PR and description accordingly.

@allburov allburov merged commit 3984cff into devopshq:master Jun 28, 2024
2 checks passed
@allburov
Copy link
Member

@christianwaldmann Thank you! 🤗

@christianwaldmann christianwaldmann deleted the display-format branch June 28, 2024 16:31
zkygr pushed a commit to zkygr/artifactory-cleanup that referenced this pull request Jul 10, 2024
* add --display-format

* add tests for --display-format

* change default display format to include sha1 hash

* remove --display-format and include hash by default instead

---------

Co-authored-by: christianwaldmann <christianwaldmann>
zkygr pushed a commit to zkygr/artifactory-cleanup that referenced this pull request Jul 10, 2024
* add --display-format

* add tests for --display-format

* change default display format to include sha1 hash

* remove --display-format and include hash by default instead

---------

Co-authored-by: christianwaldmann <christianwaldmann>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants