-
Notifications
You must be signed in to change notification settings - Fork 505
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 pkg/announce
package into sub-packages and interface pattern
#3580
Conversation
Signed-off-by: Marvin Beckers <[email protected]>
Signed-off-by: Marvin Beckers <[email protected]>
Signed-off-by: Marvin Beckers <[email protected]>
Signed-off-by: Marvin Beckers <[email protected]>
Signed-off-by: Marvin Beckers <[email protected]>
Signed-off-by: Marvin Beckers <[email protected]>
Hi @embik. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/cc @xmudrii |
/ok-to-test |
Signed-off-by: Marvin Beckers <[email protected]>
Signed-off-by: Marvin Beckers <[email protected]>
/assign @saschagrunert |
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.
Thanks!
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: embik, saschagrunert The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
This PR is a proposal for #3565, a refactor that came up while #3559 was in review. Essentially, the
pkg/announce
package doesn't follow the interface pattern established across many SIG Release packages and as such, it is hard to implement tests for it.While working on this, I realised that
pkg/announce
is actually three distinct things in a trench coat (generating the announcement text, updating the GitHub release and generating the SBOM), so I've further refactored the package and split the GitHub release and SBOM generation into sub-packages. I kept them inpkg/announce
because that's where the code was before, I'm not sure if they strictly need to be there.For implementations, I tried to move out code that was interfacing with e.g. the filesystem so that tests can simulate interaction with the filesystem without having to write to it. That way, the "business logic" is the focus of future tests. Due to heavy usage of packages from e.g.
release-sdk
which already have interface implementations, those can easily be mocked in tests.Since this is already quite a big diff, I'd propose to add tests in a future PR. I can also squash some commits if wanted, I tried to keep a clear history of the refactor going on, but I'm not sure if that is required.
Which issue(s) this PR fixes:
Fixes #3565
Special notes for your reviewer:
Does this PR introduce a user-facing change?