-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add more unit test and e2e tests
Signed-off-by: peefy <[email protected]>
- Loading branch information
Showing
23 changed files
with
3,605 additions
and
236 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: backport | ||
|
||
on: | ||
pull_request_target: | ||
types: [closed, labeled] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
pull-request: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
if: github.event.pull_request.state == 'closed' && github.event.pull_request.merged && (github.event_name != 'labeled' || startsWith('backport:', github.event.label.name)) | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
- name: Create backport PRs | ||
uses: korthout/backport-action@be567af183754f6a5d831ae90f648954763f17f5 # v3.1.0 | ||
# xref: https://github.com/korthout/backport-action#inputs | ||
with: | ||
# Use token to allow workflows to be triggered for the created PR | ||
github_token: ${{ secrets.DEPLOY_ACCESS_TOKEN }} | ||
# Match labels with a pattern `backport:<target-branch>` | ||
label_pattern: '^backport:([^ ]+)$' | ||
# A bit shorter pull-request title than the default | ||
pull_title: '[${target_branch}] ${pull_title}' | ||
# Simpler PR description than default | ||
pull_description: |- | ||
Automated backport to `${target_branch}`, triggered by a label in #${pull_number}. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
Copyright 2023 The Flux authors | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package v1alpha1 | ||
|
||
import "fmt" | ||
|
||
// CrossNamespaceSourceReference contains enough information to let you locate the | ||
// typed Kubernetes resource object at cluster level. | ||
type CrossNamespaceSourceReference struct { | ||
// API version of the referent. | ||
// +optional | ||
APIVersion string `json:"apiVersion,omitempty"` | ||
|
||
// Kind of the referent. | ||
// +kubebuilder:validation:Enum=OCIRepository;GitRepository;Bucket | ||
// +required | ||
Kind string `json:"kind"` | ||
|
||
// Name of the referent. | ||
// +required | ||
Name string `json:"name"` | ||
|
||
// Namespace of the referent, defaults to the namespace of the Kubernetes | ||
// resource object that contains the reference. | ||
// +optional | ||
Namespace string `json:"namespace,omitempty"` | ||
} | ||
|
||
func (s *CrossNamespaceSourceReference) String() string { | ||
if s.Namespace != "" { | ||
return fmt.Sprintf("%s/%s/%s", s.Kind, s.Namespace, s.Name) | ||
} | ||
return fmt.Sprintf("%s/%s", s.Kind, s.Name) | ||
} |
Oops, something went wrong.