Skip to content

Commit

Permalink
feat(KONFLUX-3857): Stop Mintmaker creating 'chore: ...' update PRs t…
Browse files Browse the repository at this point in the history
…hat provoke 'on-pull-request' builds that might interfere with testing (#1279)
  • Loading branch information
jhutar authored Jul 29, 2024
1 parent 0283047 commit 363c095
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions pkg/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,4 +229,5 @@ var (
IntegrationTestScenarioDefaultLabels = map[string]string{"test.appstudio.openshift.io/optional": "false"}
DefaultDockerBuildPipelineBundle = map[string]string{"build.appstudio.openshift.io/pipeline": `{"name": "docker-build", "bundle": "latest"}`}
DefaultFbcBuilderPipelineBundle = map[string]string{"build.appstudio.openshift.io/pipeline": `{"name": "fbc-builder", "bundle": "latest"}`}
ComponentMintmakerDisabledAnnotation = map[string]string{"mintmaker.appstudio.redhat.com/disabled": "true"}
)
1 change: 1 addition & 0 deletions tests/load-tests/loadtest.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ func init() {
rootCmd.Flags().StringVar(&opts.JourneyDuration, "journey-duration", "1h", "repeat user journey until this timeout (either this or --journey-repeats)")
rootCmd.Flags().BoolVar(&opts.PipelineSkipInitialChecks, "pipeline-skip-initial-checks", true, "if build pipeline runs' initial checks are to be skipped")
rootCmd.Flags().BoolVar(&opts.PipelineRequestConfigurePac, "pipeline-request-configure-pac", false, "if build pipeline should be taken from component repository .tekton directory")
rootCmd.Flags().BoolVar(&opts.PipelineMintmakerDisabled, "pipeline-mintmaker-disabled", true, "if you want to stop Mintmaker to be creating update PRs for your component (default in loadtest different from Konflux default)")
rootCmd.Flags().BoolVar(&opts.MultiarchWorkflow, "multiarch-workflow", false, "if we should template repo so it is suitable for multi arch test, merge PR and ignore custom pipeline run from PR")
rootCmd.Flags().StringVarP(&opts.OutputDir, "output-dir", "o", ".", "directory where output files such as load-tests.log or load-tests.json are stored")
rootCmd.Flags().StringVar(&opts.BuildPipelineSelectorBundle, "build-pipeline-selector-bundle", "", "BuildPipelineSelector bundle to use when testing with build-definition PR")
Expand Down
9 changes: 8 additions & 1 deletion tests/load-tests/pkg/journey/handle_component.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func getPaCPull(annotations map[string]string) (string, error) {
}
}

func createComponent(f *framework.Framework, namespace, name, repoUrl, repoRevision, containerContext, containerFile, buildPipelineSelector, appName string, skipInitialChecks, requestConfigurePac bool) error {
func createComponent(f *framework.Framework, namespace, name, repoUrl, repoRevision, containerContext, containerFile, buildPipelineSelector, appName string, skipInitialChecks, requestConfigurePac, mintmakerDisabled bool) error {
// Prepare annotations to add to component
annotationsMap := constants.DefaultDockerBuildPipelineBundle
if buildPipelineSelector != "" {
Expand All @@ -89,6 +89,12 @@ func createComponent(f *framework.Framework, namespace, name, repoUrl, repoRevis
annotationsMap[key] = value
}
}
if mintmakerDisabled {
// Stop Mintmaker creating update PRs for your component
for key, value := range constants.ComponentMintmakerDisabledAnnotation {
annotationsMap[key] = value
}
}

componentObj := appstudioApi.ComponentSpec{
ComponentName: name,
Expand Down Expand Up @@ -267,6 +273,7 @@ func HandleComponent(ctx *PerComponentContext) error {
ctx.ParentContext.ApplicationName,
ctx.ParentContext.ParentContext.Opts.PipelineSkipInitialChecks,
ctx.ParentContext.ParentContext.Opts.PipelineRequestConfigurePac,
ctx.ParentContext.ParentContext.Opts.PipelineMintmakerDisabled,
)
if err != nil {
return logging.Logger.Fail(60, "Component failed creation: %v", err)
Expand Down
1 change: 1 addition & 0 deletions tests/load-tests/pkg/options/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ type Opts struct {
OutputDir string
PipelineRequestConfigurePac bool
PipelineSkipInitialChecks bool
PipelineMintmakerDisabled bool
Purge bool
PurgeOnly bool
QuayRepo string
Expand Down

0 comments on commit 363c095

Please sign in to comment.