feat: check and warn on local to remote branches mismatch #2884
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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