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 all artifacts to maintainers and issue lists when wildcard is used #4108

Merged
merged 1 commit into from
Sep 29, 2024

Conversation

zbynek
Copy link
Contributor

@zbynek zbynek commented Sep 28, 2024

Fixes #2911

Allows each component to define extra artifact names, those then inherit the same maintainers and issue tracker(s) as the parent component.

A more straightforward approach might be to just define paths explicitly for each component without using *, but since the last element of path sometimes doesn't match the component name and the component name takes precedence, I decided to add a new field to Definition for defining the extra components.

@zbynek zbynek requested a review from a team as a code owner September 28, 2024 20:35
@zbynek zbynek marked this pull request as draft September 28, 2024 20:47
@zbynek zbynek marked this pull request as ready for review September 28, 2024 23:07
@zbynek zbynek changed the title Use wildcard artifact names in maintainers index Add all artifacts to maintainers and issue lists when wildcard is used Sep 28, 2024
Copy link
Member

@timja timja left a comment

Choose a reason for hiding this comment

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

LGTM, can tweak after easily if needed

@timja timja merged commit 9ca1088 into jenkins-infra:master Sep 29, 2024
3 checks passed
@zbynek zbynek deleted the wildcard branch September 30, 2024 10:03
Copy link
Contributor

@daniel-beck daniel-beck left a comment

Choose a reason for hiding this comment

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

Should probably be documented in the readme?

Comment on lines +205 to +206
if (lastPathElement.endsWith("-releaseblocker") || lastPathElement.endsWith("-releaseblock")) {
LOGGER.log(Level.INFO, "Release blocked for artifact ID: " + artifactId)
Copy link
Contributor

Choose a reason for hiding this comment

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

Rather than add special handling for a weakly adhered to naming convention, if we add code for this case, it should just be a new attribute.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in #4127


if (maintainersByComponent.containsKey(key)) {
LOGGER.log(Level.WARNING, "Duplicate maintainers entry for component: " + key)
if (lastPathElement.contains("*")) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems unnecessarily complicated, because extraNames is expected to only exist with wildcard in the first place?

@@ -358,6 +364,16 @@ class ArtifactoryPermissionsUpdater {
new File('checks-details.txt').text = details
}

private static void addMaintainers(HashMap<String, List<String>> maintainersByComponent, String key, Definition definition) {
if (maintainersByComponent.containsKey(key)) {
LOGGER.log(Level.WARNING, "Duplicate maintainers entry for component: " + key)
Copy link
Contributor

Choose a reason for hiding this comment

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

Interestingly, we have some of these in the log. Anyone want to look into this?

@daniel-beck
Copy link
Contributor

define paths explicitly for each component without using *

Needs to be tested first. For some plugins that moved groupIds a few times we had to remove the old ones due to permission target length limitations at the time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide maintainer information for prefix/wildcard hack plugins
3 participants