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

fix: downstream tests assume release branch was cut #3047

Merged
merged 6 commits into from
Jun 2, 2024

Conversation

asr2003
Copy link
Contributor

@asr2003 asr2003 commented Jun 1, 2024

Changes

🐛 Fix bug of release branch cut:

Added following additional steps to downstream.yaml for the scenario if the checkout fails - it should fallback and checkout the main branch downstream

  • Set Branch to Main if Checkout Fails: Sets the BRANCH environment variable to main if the downstream checkout fails.
  • Set Branch to PR Base Ref if Checkout Succeeds: Sets the BRANCH environment variable to the PR base branch if the checkout succeeds.
  • Checkout Downstream with Fallback Branch: Uses the fall back branch main if the checkout failed or the PR base branch if it succeeded.

/kind enhancement
cc: @dprotaso

Copy link

knative-prow bot commented Jun 1, 2024

@asr2003: The label(s) kind/<kind> cannot be applied, because the repository doesn't have them.

In response to this:

Changes

/kind

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-sigs/prow repository.

@knative-prow knative-prow bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 1, 2024
@knative-prow knative-prow bot requested review from Leo6Leo and skonto June 1, 2024 08:01
Copy link

knative-prow bot commented Jun 1, 2024

Hi @asr2003. Thanks for your PR.

I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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-sigs/prow repository.

@knative-prow knative-prow bot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jun 1, 2024
@asr2003 asr2003 marked this pull request as ready for review June 1, 2024 08:10
@knative-prow knative-prow bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 1, 2024
@knative-prow knative-prow bot requested review from Cali0707 and ReToCode June 1, 2024 08:10
@asr2003
Copy link
Contributor Author

asr2003 commented Jun 1, 2024

@Cali0707 @Leo6Leo @skonto PTAL and can approve the workflows?

Comment on lines 92 to 97
- name: Checkout downstream with fallback branch
uses: actions/checkout@v4
with:
ref: ${{ env.BRANCH }}
repository: ${{ matrix.repo }}
path: downstream
Copy link
Member

Choose a reason for hiding this comment

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

We can skip this step if the earlier checkout succeeded

Copy link
Member

Choose a reason for hiding this comment

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

Might be simpler to not use the env var and collapse the steps into something like this

    - name: Checkout downstream with fallback branch
      if: steps.checkout-downstream.outcome == 'failure'
      uses: actions/checkout@v4
      with:
        ref: main
        repository: ${{ matrix.repo }}
        path: downstream

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Simplified steps as changes suggested

go.sum Outdated Show resolved Hide resolved
@asr2003
Copy link
Contributor Author

asr2003 commented Jun 2, 2024

Sure, I will make incorporate the requested changes

@asr2003 asr2003 requested a review from dprotaso June 2, 2024 02:48
Copy link

codecov bot commented Jun 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.73%. Comparing base (7d52a43) to head (0dd60c1).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3047   +/-   ##
=======================================
  Coverage   78.73%   78.73%           
=======================================
  Files         189      189           
  Lines        8872     8872           
=======================================
  Hits         6985     6985           
  Misses       1621     1621           
  Partials      266      266           

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

@dprotaso
Copy link
Member

dprotaso commented Jun 2, 2024

/ok-to-test
/lgtm
/approve

thanks

@knative-prow knative-prow bot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Jun 2, 2024
@knative-prow knative-prow bot added lgtm Indicates that a PR is ready to be merged. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 2, 2024
Copy link

knative-prow bot commented Jun 2, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: asr2003, dprotaso

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

@knative-prow knative-prow bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 2, 2024
@knative-prow knative-prow bot merged commit 229e527 into knative:main Jun 2, 2024
37 checks passed
@asr2003 asr2003 deleted the fix-release-cut branch June 3, 2024 04:30
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. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Downstream tests assume release branch was cut
2 participants