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

for single component applications keep the contexts as pull_request #48

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions cmd/konflux/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -349,8 +349,14 @@ func generateKonflux(application k.Application, target string) error {
if err := generateFileFromTemplate("application.yaml", application, filepath.Join(target, application.Version, "application.yaml")); err != nil {
return err
}
if err := generateFileFromTemplate("tests.yaml", application, filepath.Join(target, application.Version, "tests.yaml")); err != nil {
return err
if len(application.Components) == 1 {
Copy link
Member

Choose a reason for hiding this comment

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

even for multiple components for pull_request i don't see EC running sometime
ex: openshift-pipelines/tektoncd-pipeline#278

Copy link
Contributor Author

Choose a reason for hiding this comment

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

lets keep the PR open for some time.

As this PR is merged so there is no much data. we will try to find some other PR where EC not triggered and then check their configuration.

if err := generateFileFromTemplate("tests_pr.yaml", application, filepath.Join(target, application.Version, "tests.yaml")); err != nil {
return err
}
} else {
if err := generateFileFromTemplate("tests.yaml", application, filepath.Join(target, application.Version, "tests.yaml")); err != nil {
return err
}
}
if err := generateFileFromTemplate("tests-on-push.yaml", application, filepath.Join(target, application.Version, "tests-on-push.yaml")); err != nil {
return err
Expand Down
25 changes: 25 additions & 0 deletions cmd/konflux/templates/konflux/tests_pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Generated by openshift-pipelines/hack. DO NOT EDIT.
---
apiVersion: appstudio.redhat.com/v1beta2
kind: IntegrationTestScenario
metadata:
name: {{.Name}}-{{hyphenize .Version}}-enterprise-contract-group
spec:
application: {{.Name}}-{{hyphenize .Version}}
contexts:
- description: Application testing
name: pull_request
params:
- name: POLICY_CONFIGURATION
value: tekton-ecosystem-tenant/tekton-ecosystem-tenant-containers
- name: TIMEOUT
value: "15m0s"
resolverRef:
params:
- name: url
value: "https://github.com/konflux-ci/build-definitions"
- name: revision
value: main
- name: pathInRepo
value: pipelines/enterprise-contract.yaml
resolver: git