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

refactor(plugin-odap-hermes): rename package, variables ODAP -> SATP #3006

Merged
merged 1 commit into from
Feb 7, 2024

Conversation

AndreAugusto11
Copy link
Contributor

@AndreAugusto11 AndreAugusto11 commented Jan 30, 2024

  • renamed every variable from odap to satp
  • left out CHANGELOG files

Closes #2809

cc @RafaelAPB

@AndreAugusto11 AndreAugusto11 force-pushed the satp-refactoring branch 4 times, most recently from b783cb6 to 55e9298 Compare February 1, 2024 17:35
@petermetz petermetz changed the title feat(satp): refactor ODAP package to SATP refactor(plugin-odap-hermes): rename package, variables ODAP -> SATP Feb 2, 2024
Copy link
Contributor

@petermetz petermetz left a comment

Choose a reason for hiding this comment

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

@AndreAugusto11 LGTM with comment(s)

  1. Please update the commit subject line to go like the string I just set the PR title to (refactor(plugin-odap-hermes): rename package, variables ODAP -> SATP) this way it's clearer which specific plugin had the renaming done and also that it's not a new feature just a refactor of an existing feature. The reason why I pick on this is the generated release notes which would include it as a new feature but we had it for quite a while!

@AndreAugusto11
Copy link
Contributor Author

@AndreAugusto11 LGTM with comment(s)

  1. Please update the commit subject line to go like the string I just set the PR title to (refactor(plugin-odap-hermes): rename package, variables ODAP -> SATP) this way it's clearer which specific plugin had the renaming done and also that it's not a new feature just a refactor of an existing feature. The reason why I pick on this is the generated release notes which would include it as a new feature but we had it for quite a while!

@petermetz, that makes much sense. Fixed! Thanks

@AndreAugusto11
Copy link
Contributor Author

Note: an important takeaway from this PR is that variable names in a package should not be so dependent on the name of the package (e.g., instead of calling a log IOdapLocalLog, just call it ILocalLog, given that it is already being defined within the plugin-odap-hermes package). It would have simplified this PR and might be helpful in future refactors.

@petermetz
Copy link
Contributor

Note: an important takeaway from this PR is that variable names in a package should not be so dependent on the name of the package (e.g., instead of calling a log IOdapLocalLog, just call it ILocalLog, given that it is already being defined within the plugin-odap-hermes package). It would have simplified this PR and might be helpful in future refactors.

@AndreAugusto11 I agree with what you said, but I can also see why the higher specificity of the naming can help in situations where the code imports from multiple different plugins and then there would be multiple different ILocalLog classes to juggle (which would force you to rename them upon import). On the other hand the renaming refactor is probably something that happens not that often so having a better developer experience for the day to day use with higher specificity might be the way to go. So in the end my take is that it just depends. :-)

Note for future: Don't forget to re-request review. I'm only seeing this now because I was going through older messages but it wasn't (still isn't) in my PR review queue.

@petermetz petermetz self-requested a review February 6, 2024 03:51
Copy link
Contributor

@petermetz petermetz left a comment

Choose a reason for hiding this comment

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

LGTM

@outSH
Copy link
Contributor

outSH commented Feb 6, 2024

@AndreAugusto11 Looks good but fix required tests yarn_lint and yarn_codegen. In a former you probably need to add exceptions for Satp, satp etc.. in .cspell files, for latter rebase with main and run codegen.

@AndreAugusto11 AndreAugusto11 force-pushed the satp-refactoring branch 2 times, most recently from ae523b0 to 6ec60d3 Compare February 6, 2024 18:37
@AndreAugusto11
Copy link
Contributor Author

Note: an important takeaway from this PR is that variable names in a package should not be so dependent on the name of the package (e.g., instead of calling a log IOdapLocalLog, just call it ILocalLog, given that it is already being defined within the plugin-odap-hermes package). It would have simplified this PR and might be helpful in future refactors.

@AndreAugusto11 I agree with what you said, but I can also see why the higher specificity of the naming can help in situations where the code imports from multiple different plugins and then there would be multiple different ILocalLog classes to juggle (which would force you to rename them upon import). On the other hand the renaming refactor is probably something that happens not that often so having a better developer experience for the day to day use with higher specificity might be the way to go. So in the end my take is that it just depends. :-)

Note for future: Don't forget to re-request review. I'm only seeing this now because I was going through older messages but it wasn't (still isn't) in my PR review queue.

Have a good point there! This is probably more suited to local variable names in function arguments, test files, etc...

@AndreAugusto11
Copy link
Contributor Author

@petermetz @outSH thank you both for your comments!!

Copy link
Contributor

@petermetz petermetz left a comment

Choose a reason for hiding this comment

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

@AndreAugusto11 Plus one to @outSH 's request above! Otherwise LGTM!

image

Error: yarn codegen script produced version control side-effects: source files have been changed by it that are otherwise are under version control. This means (99% of the time) that you need to run the yarn codegen script locally and then include the changes it makes in your own commit when submitting your pull request.

* renamed every variable from odap to satp
* left out CHANGELOG files

Signed-off-by: André Augusto <andre.augusto@tecnico.ulisboa.pt>
Copy link
Contributor

@petermetz petermetz left a comment

Choose a reason for hiding this comment

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

@AndreAugusto11 Thank you for fixing the codegen check! LGTM

@petermetz petermetz merged commit 4184cf2 into hyperledger-cacti:main Feb 7, 2024
130 of 146 checks passed
AndreAugusto11 added a commit to AndreAugusto11/cacti that referenced this pull request Feb 7, 2024
*implement the repository design pattern to make storage technology-agnostic
* due to the deprecation of the ipfs package, this allows one to choose another storage
* refactoring of the tests and the CBDC example that is based on the SATP
* implement the remote log storage as a SQLite database
* add post-build instruction to copy knex files to dist/

closes hyperledger-cacti#2984

depends on hyperledger-cacti#3006

Signed-off-by: André Augusto <andre.augusto@tecnico.ulisboa.pt>
AndreAugusto11 added a commit to AndreAugusto11/cacti that referenced this pull request Feb 7, 2024
*implement the repository design pattern to make storage technology-agnostic
* due to the deprecation of the ipfs package, this allows one to choose another storage
* refactoring of the tests and the CBDC example that is based on the SATP
* implement the remote log storage as a SQLite database
* add post-build instruction to copy knex files to dist/

closes hyperledger-cacti#2984

depends on hyperledger-cacti#3006

Signed-off-by: André Augusto <andre.augusto@tecnico.ulisboa.pt>
AndreAugusto11 added a commit to AndreAugusto11/cacti that referenced this pull request Feb 7, 2024
*implement the repository design pattern to make storage technology-agnostic
* due to the deprecation of the ipfs package, this allows one to choose another storage
* refactoring of the tests and the CBDC example that is based on the SATP
* implement the remote log storage as a SQLite database
* add post-build instruction to copy knex files to dist/

closes hyperledger-cacti#2984

depends on hyperledger-cacti#3006

Signed-off-by: André Augusto <andre.augusto@tecnico.ulisboa.pt>
petermetz pushed a commit that referenced this pull request Feb 7, 2024
*implement the repository design pattern to make storage technology-agnostic
* due to the deprecation of the ipfs package, this allows one to choose another storage
* refactoring of the tests and the CBDC example that is based on the SATP
* implement the remote log storage as a SQLite database
* add post-build instruction to copy knex files to dist/

closes #2984

depends on #3006

Signed-off-by: André Augusto <andre.augusto@tecnico.ulisboa.pt>
@AndreAugusto11 AndreAugusto11 deleted the satp-refactoring branch February 7, 2024 17:17
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.

feat(satp-hermes): refactor package
3 participants