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: ♻️ use checks in write_resource_properties() #990

Merged
merged 97 commits into from
Jan 27, 2025

Conversation

martonvago
Copy link
Contributor

@martonvago martonvago commented Jan 22, 2025

Description

This PR switches to the new check functions in write_resource_properties.

There is probably an argument for reorganising this function a bit, but in this PR I am just adding the check functions.

This PR needs an in-depth review.

Checklist

  • Added or updated tests
  • Updated documentation
  • Ran just run-all

martonvago and others added 30 commits December 19, 2024 15:03
Co-authored-by: Luke W. Johnston <[email protected]>
Co-authored-by: Signe Kirk Brødbæk <[email protected]>
Co-authored-by: Signe Kirk Brødbæk <[email protected]>
@martonvago martonvago self-assigned this Jan 22, 2025
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This could do with a couple more tests, but I expect the function to change a bit, so I'll add them a bit later.

@martonvago
Copy link
Contributor Author

Having looked at these functions a bit, maybe a natural organisation would be:

  • edit_package_properties (leave as is):
    • takes a partial PackageProperties
    • returns a complete PackageProperties, ready to write to file
  • edit_resource_properties (= most of the current write_resource_properties):
    • takes a partial ResourceProperties
    • returns a complete PackageProperties, ready to write to file
  • write_properties (= the current write_package_properties)
    • takes a complete PackageProperties

The big change here would be that edit_resource_properties would return a PackageProperties (with the ResourceProperties updated or added). This gives a nice flow, but I'm not sure if it's misleading?

@martonvago martonvago marked this pull request as ready for review January 22, 2025 15:33
@martonvago martonvago requested a review from a team as a code owner January 22, 2025 15:33
@lwjohnst86 lwjohnst86 changed the title refactor: ♻️ use check functions in write_resource_properties refactor: ♻️ use checks in write_resource_properties() Jan 23, 2025
Base automatically changed from refactor/use-check-error-matcher to main January 23, 2025 10:10
Copy link
Member

@lwjohnst86 lwjohnst86 left a comment

Choose a reason for hiding this comment

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

👍

@lwjohnst86 lwjohnst86 merged commit c10d053 into main Jan 27, 2025
3 checks passed
@lwjohnst86 lwjohnst86 deleted the refactor/use-checks-in-write-res-props branch January 27, 2025 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants