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

[TEP-0137] Rename customrun package #6884

Merged
merged 1 commit into from
Jul 5, 2023

Conversation

afrittoli
Copy link
Member

@afrittoli afrittoli commented Jun 28, 2023

Dependencies:

Once dependencies are merged, the PR will contain 1 commit only

Changes

The pkg/reconciler/customrun package contains a controller that
today sends cloudevents for CustomRuns. In the context of TEP-0137,
this controller will be repurposed to send events for all resources,
so the current name does not make sense anymore.

Renaming the package to "notifications", because the "events" and
"cloudevents" names are already used elsewhere and we don't want
a mass API rename for this. We might consolidate the code further
as a follow-up. The new name is also more future-proof, as the
controller may in future handle other kinds of non-cloudevents
type of notifications.

When renaming I realised that the customrun controller was being
started as part of the main controller as well as an independent
one. This PR fixes that bug as well.

Signed-off-by: Andrea Frittoli andrea.frittoli@uk.ibm.com

Submitter Checklist

As the author of this PR, please check off the items in this checklist:

  • Has Docs if any changes are user facing, including updates to minimum requirements e.g. Kubernetes version bumps
  • Has Tests included if any functionality added or changed
  • Follows the commit message standard
  • Meets the Tekton contributor standards (including functionality, content, code)
  • Has a kind label. You can add one by adding a comment on this PR that contains /kind <type>. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tep
  • Release notes block below has been updated with any user facing changes (API changes, bug fixes, changes requiring upgrade notices or deprecation warnings). See some examples of good release notes.
  • Release notes contains the string "action required" if the change requires additional action from users switching to the new release

Release Notes

The `CustomRun` events controller has been moved to the `pkg/reconciler/notifications` package.

/kind misc

@tekton-robot tekton-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/misc Categorizes issue or PR as a miscellaneuous one. labels Jun 28, 2023
@tekton-robot tekton-robot requested review from abayer and dibyom June 28, 2023 10:05
@tekton-robot tekton-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Jun 28, 2023
@afrittoli afrittoli marked this pull request as draft June 28, 2023 10:13
@tekton-robot tekton-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 28, 2023
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/config/events.go Do not exist 98.1%
pkg/apis/config/store.go 91.7% 92.6% 0.9
pkg/reconciler/events/cloudevent/cloud_event_controller.go 84.9% 84.6% -0.3
pkg/reconciler/notifications/controller.go Do not exist 100.0%
pkg/reconciler/notifications/notifications.go Do not exist 100.0%
test/controller.go 29.4% 30.1% 0.7

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/config/events.go Do not exist 98.1%
pkg/apis/config/store.go 91.7% 92.6% 0.9
pkg/reconciler/events/cloudevent/cloud_event_controller.go 84.9% 84.6% -0.3
pkg/reconciler/notifications/controller.go Do not exist 100.0%
pkg/reconciler/notifications/notifications.go Do not exist 100.0%
test/controller.go 29.4% 30.1% 0.7

@afrittoli afrittoli changed the title [TEP-0137] Rename customrun package to notifications [TEP-0137] Rename customrun package Jun 28, 2023
@afrittoli afrittoli marked this pull request as ready for review June 28, 2023 10:22
@tekton-robot tekton-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 28, 2023
@tekton-robot tekton-robot requested review from lbernick and wlynch June 28, 2023 10:22
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/config/events.go Do not exist 98.1%
pkg/apis/config/store.go 91.7% 92.6% 0.9
pkg/reconciler/events/cloudevent/cloud_event_controller.go 84.9% 84.6% -0.3
pkg/reconciler/notifications/customrun/controller.go Do not exist 100.0%
pkg/reconciler/notifications/customrun/customrun.go Do not exist 100.0%
test/controller.go 29.4% 30.1% 0.7

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/config/events.go Do not exist 98.1%
pkg/apis/config/store.go 91.7% 92.6% 0.9
pkg/reconciler/events/cloudevent/cloud_event_controller.go 84.9% 84.6% -0.3
pkg/reconciler/notifications/customrun/controller.go Do not exist 100.0%
pkg/reconciler/notifications/customrun/customrun.go Do not exist 100.0%
test/controller.go 29.4% 30.1% 0.7

@afrittoli afrittoli added kind/tep Categorizes issue or PR as related to a TEP (or needs a TEP). and removed kind/tep Categorizes issue or PR as related to a TEP (or needs a TEP). labels Jun 30, 2023
@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lbernick

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 30, 2023
The pkg/reconciler/customrun package contains a controller that
today sends cloudevents for CustomRuns. In the context of TEP-0137,
more controllers will be added to send events for all resources,
so the current name does not make sense anymore.

Renaming the package to "notifications/customrun", so that the
notifications package may hold the various controllers for the
different kind of resources. The "events" and "cloudevents" names
are already used elsewhere and we don't want a mass API rename
for this. We might consolidate the code further as a follow-up.
The new name is also more future-proof, as the controllers may
in future handle other kinds of non-cloudevents type of notifications.

When renaming I realised that the customrun controller was being
started as part of the main controller as well as an independent
one. This PR fixes that bug as well.

Signed-off-by: Andrea Frittoli <andrea.frittoli@uk.ibm.com>
@tekton-robot tekton-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jul 3, 2023
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/notifications/customrun/controller.go Do not exist 100.0%
pkg/reconciler/notifications/customrun/customrun.go Do not exist 100.0%

@afrittoli
Copy link
Member Author

/retest

@afrittoli
Copy link
Member Author

/test pull-tekton-pipeline-go-coverage-df

@tekton-robot
Copy link
Collaborator

@afrittoli: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test pull-tekton-pipeline-alpha-integration-tests
  • /test pull-tekton-pipeline-beta-integration-tests
  • /test pull-tekton-pipeline-build-tests
  • /test pull-tekton-pipeline-integration-tests
  • /test tekton-pipeline-unit-tests

The following commands are available to trigger optional jobs:

  • /test pull-tekton-pipeline-go-coverage

Use /test all to run all jobs.

In response to this:

/test pull-tekton-pipeline-go-coverage-df

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.

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/notifications/customrun/controller.go Do not exist 100.0%
pkg/reconciler/notifications/customrun/customrun.go Do not exist 100.0%

@afrittoli
Copy link
Member Author

/test pull-tekton-pipeline-beta-integration-tests

Copy link
Member

@wlynch wlynch left a comment

Choose a reason for hiding this comment

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

/lgtm

One question though - would this break downstream customrun implementations? Should we leave behind a simple package that type aliases to the new package?

If this is truly only for cloudevent notifications, you may also want to add a doc.go with some documentation calling this out.

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 5, 2023
@wlynch
Copy link
Member

wlynch commented Jul 5, 2023

/approve cancel (approve was set before LGTM - undo-ing to give a chance to respond to the comment)

@wlynch
Copy link
Member

wlynch commented Jul 5, 2023

/remove-approve

@tekton-robot tekton-robot merged commit a9017c5 into tektoncd:main Jul 5, 2023
@afrittoli
Copy link
Member Author

/lgtm

One question though - would this break downstream customrun implementations? Should we leave behind a simple package that type aliases to the new package?

If this is truly only for cloudevent notifications, you may also want to add a doc.go with some documentation calling this out.

Thanks @wlynch - it looks like the un-approve didn't work, so I'll address your comments as a follow-up.
The package is exclusively used to provide the ability to send cloud events for CustomRuns, it's not something that custom run controller implementors would use.

If you prefer I can introduce an alias; in #6889 however I started restructuring that package in preparation for "TEP-0137", so I'm not sure an alias would be very helpful (or alternatively I will have rework that PR and the following one to keep the old methods around).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/misc Categorizes issue or PR as a miscellaneuous one. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants