Skip to content

feat: check and warn on local to remote branches mismatch #2884

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
Jun 27, 2025

Conversation

lkingland
Copy link
Member

Warn the user when the local branch is different than the configured remote build target branch (revision).

Example:

A user is working on the main branch locally, but wants to trigger a remote deployment of a specific branch feature-xyz.

$ func deploy --remote --git-branch feature-xyz

Here, a remote deployment is triggered which uses the Git repository and pulls code from feature-xyz

This will still use the func.yaml from the local main branch for function metadata (name, runtime, environment variables, etc.)

This can create a problem when there is a pertinent difference between the two brances' func.yaml.

The longer-term fix for this is to update the pipelines flow to pull the repository and reference indicated on demand. This warning is a stop-gap.

The warning encourages the user to first checkout the feature-xyz branch locally before triggering the remote deployment, ensuring the function metadata matches the code being deployed.

/kind enhancement

User will be warned when their local branch differs from that configured for remote builds.

@knative-prow knative-prow bot added kind/enhancement approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jun 24, 2025
@knative-prow knative-prow bot requested review from jrangelramos and vyasgun June 24, 2025 13:18
@knative-prow knative-prow bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jun 24, 2025
Copy link

codecov bot commented Jun 24, 2025

Codecov Report

Attention: Patch coverage is 95.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 62.76%. Comparing base (1cccfd3) to head (6a3e7b9).
Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
cmd/deploy.go 95.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2884      +/-   ##
==========================================
+ Coverage   57.96%   62.76%   +4.79%     
==========================================
  Files         129      129              
  Lines       15767    15827      +60     
==========================================
+ Hits         9140     9934     +794     
+ Misses       5785     4950     -835     
- Partials      842      943     +101     
Flag Coverage Δ
e2e-tests 43.17% <70.00%> (+7.99%) ⬆️
integration-tests 48.93% <80.00%> (?)
unit-tests 49.04% <80.00%> (-0.07%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@gauron99 gauron99 left a comment

Choose a reason for hiding this comment

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

/lgtm

@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label Jun 27, 2025
Copy link

knative-prow bot commented Jun 27, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gauron99, lkingland

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 merged commit c990659 into knative:main Jun 27, 2025
59 of 63 checks passed
@lkingland lkingland deleted the push-uwlvlwznqxqp branch June 30, 2025 01:52
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/enhancement lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants