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

Change default value for the branch parameter to 'main' #8045

Closed
2 tasks done
fniessink opened this issue Feb 7, 2024 · 0 comments · Fixed by #8588 or #8693
Closed
2 tasks done

Change default value for the branch parameter to 'main' #8045

fniessink opened this issue Feb 7, 2024 · 0 comments · Fixed by #8588 or #8693
Assignees

Comments

@fniessink
Copy link
Member

fniessink commented Feb 7, 2024

Tasks:

  • Add migration script to change branches without a value to 'master'. Old sources have branch parameters without value. Apparently, the default value of parameters has not always been inserted into reports.
  • Also investigate whether the Branch and Branches parameter can be combined. In that case no default value would be needed.

Combining the Branch and Branches parameters

The Branch parameter is only used by GitLab and AzureDevOps, both for the metric: source_up_to_dateness.

The Branches parameters is only used by GitLab for the metric: pipeline_duration.

Note that SonarQube also has a branch parameter, but it's not derived from Branch, but rather a separate StringParameter. The analysis below only covers the use of Branch by GitLab and AzureDevOps.

To decide whether Branch and Branches can be combined it's important to look at the default values of the parameters. Branches has as default value "all branches". Branch has master (after this issue is completed: main) as default value.

When configuring GitLab or Azure DevOps as source for the source_up_to_dateness metric, users can measure the up-to-dateness of files and of pipelines. The Branch parameter is only used in case of the files option: users can specify for which branch the up-to-dateness of the file should be measured.

If we would replace the Branch parameter with the Branches parameter, Quality-time is basically saying that by default users will want to track the up-to-dateness of files across all branches. We haven't had that request from users.

Alternatively, we could change the default value of the Branches parameter to main. That would impact only the pipeline_duration metric when used with GitLab as source. Users that want to measure the duration of all pipelines regardless of branch would have to delete main from the parameter value. It seems more likely that users would want to measure the duration of all pipelines instead of just the main branch.

Getting rid of the Branch parameter would save five lines of code in the data model.

Conclusion: merging the two parameters would worsen user experience in return for a very small reduction of code size. It's not worth it.

@fniessink fniessink self-assigned this Apr 28, 2024
fniessink added a commit that referenced this issue Apr 28, 2024
Make the default value of branch parameters `main` instead of `master`.

Note: no migration code is needed because Quality-time only uses the default value of the branch parameter upon creation of a source. Changing the default value of the branch parameter does not impact existing sources.

Closes #8045.
@fniessink fniessink linked a pull request Apr 28, 2024 that will close this issue
fniessink added a commit that referenced this issue Apr 28, 2024
Make the default value of branch parameters `main` instead of `master`.

Note: no migration code is needed because Quality-time only uses the default value of the branch parameter upon creation of a source. Changing the default value of the branch parameter does not impact existing sources.

Closes #8045.
fniessink added a commit that referenced this issue Apr 30, 2024
Make the default value of branch parameters `main` instead of `master`.

Note: no migration code is needed because Quality-time only uses the default value of the branch parameter upon creation of a source. Changing the default value of the branch parameter does not impact existing sources.

Closes #8045.
fniessink added a commit that referenced this issue May 2, 2024
Make the default value of branch parameters `main` instead of `master`.

Note: no migration code is needed because Quality-time only uses the default value of the branch parameter upon creation of a source. Changing the default value of the branch parameter does not impact existing sources.

Closes #8045.
@fniessink fniessink reopened this May 16, 2024
fniessink added a commit that referenced this issue May 16, 2024
@fniessink fniessink linked a pull request May 16, 2024 that will close this issue
fniessink added a commit that referenced this issue May 16, 2024
fniessink added a commit that referenced this issue May 16, 2024
fniessink added a commit that referenced this issue May 16, 2024
fniessink added a commit that referenced this issue May 16, 2024
fniessink added a commit that referenced this issue May 16, 2024
fniessink added a commit that referenced this issue May 16, 2024
fniessink added a commit that referenced this issue May 17, 2024
fniessink added a commit that referenced this issue May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
1 participant