-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Add Pseudonymization to CLI #13158
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 Pseudonymization to CLI #13158
Conversation
- A new pseudonymize command has been created. - Test cases has been added. - The display of commands has been sorted for ease of use. - An entry has been added to CHANGELOG.md.
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.
Quick check while on the road. Maybe you can address this before a full review?
@calixtus for the output file shall I add check (of it's existence while output option is not passed) before parsing result or at the end where the new database is saved... and shall I ask the user to overwrite or not or define numerical formate automatically (origin_pseudo_1.bib, origin_pseudo_2.bib ...) ? |
Test the logic you implement, not the logic, you imported by dependencies. If you feel that this is a not-trivial test, then do it. If you are just testing already tested logic its superfluous. |
This might not be real TDD, but real TDD is too much noise anyway imho. |
@paudelritij It would be nice if you wrote the new command on the PR description - then it is easier for non-programmers to follow...
I answered in-line, but I repeat:
|
Thank you for the comprehensive review. I have already implemented some of the suggestions yesterday and will make the necessary changes asap |
Don't forget to push after commiting, so we can follow |
- Implement ADR 0045 - Add -f / --force flag to overwrite if file exist - Reformat saving of database to save meta-data as well - Add methods from FileUtil - Reformat CHANGELOG.md entry - Add JabRef_en.properties entry - A Comment added - Remove duplicate file Chocolate.bib - Improve logger and localization lang - Remove trivial test case - Rename all occurrence of word anon. to pseudo
For ADR one needs to add this as dependency to |
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.
Overwrite output file(s) if it exist
reads strange. replace by
Overwrite output file(s) if any exist(s)
The path is not resolved correctly.
If no output file names are given, the output should be stored next to the input file.
./gradlew :jabkit:run --args="pseudonymize --input=C:\git-repositories\jabref-all\jabref-demo-libraries\chocolate\Chocolate.bib"
Results in output in jabkit folder - very strange
- Default output file path is now the same as input file location if not specified. - Created a single method to check for file existence.
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.
On CLI output:
...
is progress...
intead of
Pseudonymizing library 'Chocolate'.
Saving: C:\git-repositories\jabref-all\jabref-demo-libraries\chocolate\Chocolate.pseudo.bib.
Saving: C:\git-repositories\jabref-all\jabref-demo-libraries\chocolate\Chocolate.pseudo.csv.
Please
Pseudonymizing library 'Chocolate'...
Saved C:\git-repositories\jabref-all\jabref-demo-libraries\chocolate\Chocolate.pseudo.bib.
Saved C:\git-repositories\jabref-all\jabref-demo-libraries\chocolate\Chocolate.pseudo.csv.
`´`
Saving does not take long time, thus it can be the output oafer successful save
f36591c
to
39a904e
Compare
@trag-bot didn't find any issues in the code! ✅✨ |
@trag-bot didn't find any issues in the code! ✅✨ |
…or-test * upstream/main: (102 commits) Try to fix output Improve AI preferences UI and templates (JabRef#13202) Bump jablib/src/main/abbrv.jabref.org from `6926b83` to `333c2f1` (JabRef#13216) Bump jablib/src/main/resources/csl-styles from `8a2317a` to `c3df987` (JabRef#13215) Fixed search result focus handling (JabRef#13174) New Crowdin updates (JabRef#13214) Add Pseudonymization to CLI (JabRef#13158) Try parallel gource build Update gource.yml Fix position of checkout Preapre: Enable gradle configuration cache (JabRef#13212) Add yml as YAML extension (JabRef#13213) Fix wrong detection of issue numbers (JabRef#13211) Miscellaneous refactoring - II (JabRef#13197) Run Windows tests only on main (and on demand) (JabRef#13210) Fix porcelain for consistency check (JabRef#13209) Use setup-jbang action (instead of custom call of .sh script) (JabRef#13208) Add link to JabRef guru (JabRef#13207) Switch to gradlex for modularity (JabRef#13112) feat(ci-cd): change issue URL pattern (JabRef#13206) ...
Closes #13109
This PR adds a new jabkit CLI command 'pseudonymize'.
Parameters:
--input <file> : (required) Path to the input BibTeX file to pseudonymize.
--output <file> : Path to save the pseudonymized BibTex file. (Default: <input-filename>.pseudo.bib)
--key <file> : Path to save the entries key mapping CSV file. (Default: <input-filename>.pseudo.csv)
-f, --force : Overwrite output file(s) if they already exist.
Example
Mandatory checks
CHANGELOG.md
described in a way that is understandable for the average user (if change is visible to the user)