Skip to content

feat(stoneintg-1165): resolve pipelineruns from scenario #1092

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

Merged
merged 1 commit into from
Apr 29, 2025

Conversation

14rcole
Copy link
Collaborator

@14rcole 14rcole commented Apr 8, 2025

Support referencing pipelineruns from integrationtestscenario resolver field. Uses Tekton's ResolutionRequest CR to grab remote data then creates PipelineRun in the cluster

Maintainers will complete the following section

@14rcole 14rcole marked this pull request as draft April 8, 2025 15:52
@dirgim dirgim mentioned this pull request Apr 10, 2025
3 tasks
@dirgim
Copy link
Collaborator

dirgim commented Apr 11, 2025

Note that manipulating ResolutionRequest CRs will probably require RBACs to be updated accordingly, which should be done by expanding the existing kubebuilder directives here:

//+kubebuilder:rbac:groups=appstudio.redhat.com,resources=snapshots,verbs=get;list;watch;create;update;patch;delete
//+kubebuilder:rbac:groups=appstudio.redhat.com,resources=snapshots/status,verbs=get;update;patch
//+kubebuilder:rbac:groups=appstudio.redhat.com,resources=snapshots/finalizers,verbs=update
//+kubebuilder:rbac:groups=tekton.dev,resources=pipelineruns,verbs=get;list;watch;create;update;patch;delete;deletecollection
//+kubebuilder:rbac:groups=tekton.dev,resources=pipelineruns/status,verbs=get;update;patch
//+kubebuilder:rbac:groups=appstudio.redhat.com,resources=applications/finalizers,verbs=update
//+kubebuilder:rbac:groups=appstudio.redhat.com,resources=applications,verbs=get;list;watch
//+kubebuilder:rbac:groups=appstudio.redhat.com,resources=applications/status,verbs=get
//+kubebuilder:rbac:groups=appstudio.redhat.com,resources=components,verbs=get;list;watch;update;patch
//+kubebuilder:rbac:groups=appstudio.redhat.com,resources=components/status,verbs=get;update;patch
//+kubebuilder:rbac:groups=appstudio.redhat.com,resources=releases/status,verbs=get;update;patch
//+kubebuilder:rbac:groups=appstudio.redhat.com,resources=releases,verbs=create;delete;get;list;patch;update;watch
//+kubebuilder:rbac:groups=appstudio.redhat.com,resources=releaseplans,verbs=get;list;watch
//+kubebuilder:rbac:groups=appstudio.redhat.com,resources=releaseplans/status,verbs=get;update;patch

@14rcole 14rcole force-pushed the stoneintg-1165 branch 4 times, most recently from 7acd7d3 to afa7821 Compare April 14, 2025 13:03
@14rcole 14rcole force-pushed the stoneintg-1165 branch 2 times, most recently from 7615747 to b69124e Compare April 15, 2025 01:54
@codecov-commenter
Copy link

codecov-commenter commented Apr 28, 2025

Codecov Report

Attention: Patch coverage is 18.94737% with 77 lines in your changes missing coverage. Please review.

Please upload report for BASE (main@6b5eae0). Learn more about missing BASE report.

Files with missing lines Patch % Lines
tekton/integration_pipeline.go 16.85% 73 Missing and 1 partial ⚠️
internal/controller/snapshot/snapshot_adapter.go 50.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1092   +/-   ##
=======================================
  Coverage        ?   62.43%           
=======================================
  Files           ?       50           
  Lines           ?     7036           
  Branches        ?        0           
=======================================
  Hits            ?     4393           
  Misses          ?     2235           
  Partials        ?      408           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Support referencing pipelineruns from integrationtestscenario resolver
field.  Uses  Tekton's ResolutionRequest CR to grab remote data then
creates PipelineRun in the cluster

Signed-off-by: Ryan Cole <[email protected]>
@dirgim
Copy link
Collaborator

dirgim commented Apr 29, 2025

@14rcole how feasible would it be to provide unit test coverage for the pipelineRun resolution?

On first look, creating a new loader function to handle getting resolutionRequests (which is currently done here) and then using mock loaders to return a resolutionRequest with the correct status and a prepared pipelineRun yaml in its resolvedRequest.Status.Data field might be able to do most of the job, but I may be missing something.

@14rcole
Copy link
Collaborator Author

14rcole commented Apr 29, 2025

@dirgim I tried that but we can't import the loader package into the tekton package because it would create a circular dependency. I would have to migrate out either all of the constants or the functions related to creating the PipelineRuns. I decided that rather than take on such a big refactor here I would file a follow-up story. I confirmed manually that this works

Copy link
Collaborator

@dirgim dirgim left a comment

Choose a reason for hiding this comment

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

LGTM, nice work!

@kasemAlem
Copy link
Contributor

great work @14rcole
/retest

@14rcole 14rcole merged commit c94f612 into konflux-ci:main Apr 29, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants