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

Add gitops-update Pipeline parameter to support a custom target git branch #135

Merged
merged 1 commit into from
Oct 12, 2023

Conversation

LaVLaS
Copy link
Contributor

@LaVLaS LaVLaS commented Oct 6, 2023

Description

Introduce a parameter to the gitop-update-pipeline to allow users to specify a target branch name for the automated PR pipeline. The default value is still main but this will allow a PipelineRun to target custom branch like my-edge-demo

How Has This Been Tested?

I deployed this fix locally as part of the ai-edge demo that was using a new branch that was created from main

Merge criteria:

No issues with the parameter and the documentation is clear

  • The commits are squashed in a cohesive manner and have meaningful messages.
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has manually tested the changes and verified that the changes work

@LaVLaS LaVLaS changed the title Add gitops-update Pipeline parameter for custom git branch Add gitops-update Pipeline parameter to support a custom target git branch Oct 6, 2023
@@ -175,6 +175,14 @@ The `tekton/gitops-update-pipeline/example-pipelineruns/` contains some examples
In these examples, notice that there is a template Secret file for the Git credentials that are referenced by different tasks.
Create an equivalent Secret with appropriate details for your environment, and change the parameter values in the PipelineRun definition to match.

NOTE: If you are using a branch other than `main` for your gitops workflow, you will need to modify the `PipelineRuns` examples under `tekton/gitops-update-pipeline/example-pipelineruns/` to set the `gitRepoBranchBase` parameter to your custom branch name
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
NOTE: If you are using a branch other than `main` for your gitops workflow, you will need to modify the `PipelineRuns` examples under `tekton/gitops-update-pipeline/example-pipelineruns/` to set the `gitRepoBranchBase` parameter to your custom branch name
> **Note**
> If you are using a branch other than `main` for your gitops workflow, you will need to modify the `PipelineRuns` examples under `tekton/gitops-update-pipeline/example-pipelineruns/` to set the `gitRepoBranchBase` parameter to your custom branch name

Looks better:

Note
If you are using a branch other than main for your gitops workflow, you will need to modify the PipelineRuns examples under tekton/gitops-update-pipeline/example-pipelineruns/ to set the gitRepoBranchBase parameter to your custom branch name

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
NOTE: If you are using a branch other than `main` for your gitops workflow, you will need to modify the `PipelineRuns` examples under `tekton/gitops-update-pipeline/example-pipelineruns/` to set the `gitRepoBranchBase` parameter to your custom branch name
> [!NOTE]
> If you are using a branch other than `main` for your gitops workflow, you will need to modify the `PipelineRuns` examples under `tekton/gitops-update-pipeline/example-pipelineruns/` to set the `gitRepoBranchBase` parameter to your custom branch name

@piotrpdev Reading between the lines of the update from 21 July 2023 in the description of this issue, my understanding is that this is the more up-to-date syntax for this beta feature, and will replace the older syntax that you suggested. It says that "the old syntax will continue to work for some time", which I read as "we're not going to support the old syntax forever".

@@ -175,6 +175,14 @@ The `tekton/gitops-update-pipeline/example-pipelineruns/` contains some examples
In these examples, notice that there is a template Secret file for the Git credentials that are referenced by different tasks.
Create an equivalent Secret with appropriate details for your environment, and change the parameter values in the PipelineRun definition to match.

NOTE: If you are using a branch other than `main` for your gitops workflow, you will need to modify the `PipelineRuns` examples under `tekton/gitops-update-pipeline/example-pipelineruns/` to set the `gitRepoBranchBase` parameter to your custom branch name
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
NOTE: If you are using a branch other than `main` for your gitops workflow, you will need to modify the `PipelineRuns` examples under `tekton/gitops-update-pipeline/example-pipelineruns/` to set the `gitRepoBranchBase` parameter to your custom branch name
> [!NOTE]
> If you are using a branch other than `main` for your gitops workflow, you will need to modify the `PipelineRuns` examples under `tekton/gitops-update-pipeline/example-pipelineruns/` to set the `gitRepoBranchBase` parameter to your custom branch name

@piotrpdev Reading between the lines of the update from 21 July 2023 in the description of this issue, my understanding is that this is the more up-to-date syntax for this beta feature, and will replace the older syntax that you suggested. It says that "the old syntax will continue to work for some time", which I read as "we're not going to support the old syntax forever".

@adelton
Copy link
Contributor

adelton commented Oct 9, 2023

Looks good.

It would be even nicer if the pipeline could default to the primary branch without having it specified manually but that would likely need to be a change in https://github.com/tektoncd/catalog/tree/main/task/github-open-pr/0.2 to do an extra API call to figure out the base branch if not specified.

@grdryn
Copy link
Member

grdryn commented Oct 12, 2023

Merging this as it has 2 approvals. Suggestion can be optionally added asynchronously.

@adelton
Copy link
Contributor

adelton commented Oct 12, 2023

I've filed #141 to get the same done for the ACM part.

@piotrpdev piotrpdev added kind/documentation Improvements or additions to documentation kind/enhancement New feature or request labels Oct 13, 2023
@LaVLaS LaVLaS deleted the gitops-pipeline-repo-fix branch October 13, 2023 06:03
jackdelahunt pushed a commit to jackdelahunt/ai-edge that referenced this pull request Jan 23, 2024
…o-fix

Add gitops-update Pipeline parameter to support a custom target git branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/documentation Improvements or additions to documentation kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants