Skip to content

Fix: Add a check for tektonconfig status #256

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hasanawad94
Copy link

@hasanawad94 hasanawad94 commented May 11, 2025

Changes

Added a check for tektonconfig before progressing in the reconciliation process.

Fixes #167

Submitter Checklist

  • [ x ] Includes tests if functionality changed/was added
  • Includes docs if changes are user-facing
  • Set a kind label on this PR
  • [ x ] Release notes block has been filled in, or marked NONE

See the contributor guide
for details on coding conventions, github and prow interactions, and the code review process.

Release Notes

Fix: build status reports ready early when tektonconfig is at Error/not available state

@pull-request-size pull-request-size bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label May 11, 2025
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 11, 2025
@hasanawad94
Copy link
Author

Test still needs fixing

@hasanawad94 hasanawad94 force-pushed the tektonconfig-check branch 3 times, most recently from 297e2ee to 8b4504c Compare May 12, 2025 07:15
@hasanawad94 hasanawad94 marked this pull request as ready for review May 12, 2025 07:18
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 12, 2025
@openshift-ci openshift-ci bot requested review from HeavyWombat and qu1queee May 12, 2025 07:18
Copy link
Member

@adambkaplan adambkaplan left a comment

Choose a reason for hiding this comment

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

/approve

Code changes generally look good. Asking for a few changes before we call this good to merge:

  1. Add the check for not found errors
  2. Update the commit message so it is more complete. Tekton has an excellent guide on writing good commit messages.

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 14, 2025
@hasanawad94 hasanawad94 force-pushed the tektonconfig-check branch 2 times, most recently from 6cc8882 to e206635 Compare May 14, 2025 13:14
@hasanawad94
Copy link
Author

Thanks for the review @adambkaplan . Did the changes.

@hasanawad94 hasanawad94 requested a review from adambkaplan May 15, 2025 06:44
@hasanawad94 hasanawad94 marked this pull request as draft May 22, 2025 15:43
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 22, 2025
@hasanawad94
Copy link
Author

Cleaning up tests

@hasanawad94 hasanawad94 force-pushed the tektonconfig-check branch from 9a78c7c to d317fa7 Compare May 23, 2025 12:09
@openshift-ci openshift-ci bot added do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. and removed release-note labels May 23, 2025
@hasanawad94 hasanawad94 marked this pull request as ready for review May 23, 2025 12:11
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 23, 2025
@openshift-ci openshift-ci bot requested review from otaviof and SaschaSchwarze0 May 23, 2025 12:11
@hasanawad94
Copy link
Author

I have updated some tests to create the tektonconfig since its status being ready is now required after the fix

@hasanawad94 hasanawad94 changed the title add a check for tektonconfig Add a check for tektonconfig May 23, 2025
@hasanawad94 hasanawad94 changed the title Add a check for tektonconfig Add a check for tektonconfig status May 23, 2025
@qu1queee qu1queee removed their request for review May 26, 2025 06:38
@hasanawad94 hasanawad94 force-pushed the tektonconfig-check branch 2 times, most recently from 2a03ffd to a724136 Compare May 26, 2025 12:19
@hasanawad94 hasanawad94 changed the title Add a check for tektonconfig status Fix: Add a check for tektonconfig status May 26, 2025
Copy link
Contributor

@sayan-biswas sayan-biswas left a comment

Choose a reason for hiding this comment

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

Looks good to me.

Copy link

@avinal avinal left a comment

Choose a reason for hiding this comment

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

Looks good

@openshift-ci openshift-ci bot added release-note-none and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Jun 2, 2025
Copy link
Member

@adambkaplan adambkaplan left a comment

Choose a reason for hiding this comment

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

/approve

Marking this as a fix worth adding.

/hold

There is a bit of risk with this change, I'd rather not merge it as we are getting ready for the v0.16.0 release. After we release v0.16.0 I think it's fine to merge.

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 3, 2025
Copy link
Contributor

openshift-ci bot commented Jun 3, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: adambkaplan

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

@hasanawad94 hasanawad94 force-pushed the tektonconfig-check branch 2 times, most recently from 39901c5 to 446c6a5 Compare June 10, 2025 11:36
@hasanawad94
Copy link
Author

Thanks for the points @adambkaplan !
I have refactored the logic to improve its clarity and error handling.

@hasanawad94 hasanawad94 requested a review from adambkaplan June 10, 2025 11:40
@adambkaplan adambkaplan added this to the release-v0.17.0 milestone Jun 10, 2025
@adambkaplan
Copy link
Member

adambkaplan commented Jun 10, 2025

The e2e appeared to have flaked - timed out waiting for the operator pod to become ready. We may consider increasing the timeout from 5m to 10 or 15 minutes (in a separate pull request).

Copy link
Member

@adambkaplan adambkaplan left a comment

Choose a reason for hiding this comment

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

Code wise this looks good. However, I do ask that you fix the typos and formatting of the commit message. These serve as excellent reference for future maintainers (maybe even your future self!).

Tekton has excellent guidelines on how to write a well formed commit message.

Add a TektonConfig readiness check to the ShipwrightBuild reconcile
loop to ensure that the operator proceeds only when the TektonConfig
is available and ready. This prevents reconciliation
of the Build resource which depends on Tekton components.

The new function `fetchAndCheckTektonConfig`:
- Retrieves the TektonConfig resource from the cluster
- Checks its status conditions for readiness
- Logs messages for both success and failure cases
- Sets an appropriate Ready condition on the ShipwrightBuild resource
- Signals the controller to requeue if Tekton is missing or not ready

Resolves: shipwright-io#167

Signed-off-by: Hasan Awad <[email protected]>
@adambkaplan
Copy link
Member

/hold cancel

We can merge this now that Shipwright v0.16.0 has been released.

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 29, 2025
@adambkaplan adambkaplan moved this to In Progress in Shipwright Overview Aug 21, 2025
@adambkaplan
Copy link
Member

/retest

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. release-note-none size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

[BUG] Operator reports "Ready: True" when TektonConfig reports "Error"
4 participants