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
Enable CD on plugin-compat-tester
& clean up obsolete modules
#2103
Enable CD on plugin-compat-tester
& clean up obsolete modules
#2103
Conversation
Also CC @bmunozm, active in last year (but again not currently authorized in RPU). |
@@ -3,6 +3,8 @@ name: "plugins-compat-tester-aggregator" | |||
github: "jenkinsci/plugin-compat-tester" | |||
paths: | |||
- "org/jenkins-ci/tests/plugins-compat-tester-aggregator" | |||
cd: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needs to be combined in one file for multi module to work iirc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mm, maybe. #1747. @daniel-beck any idea? Would it suffice as a workaround to just add a cd
section to one component file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While
Lines 89 to 95 in fe278d5
List<Definition> definitions = cdEnabledComponentsByGitHub[definition.github] | |
if (!definitions) { | |
definitions = new ArrayList<>() | |
cdEnabledComponentsByGitHub[definition.github] = definitions | |
} | |
LOGGER.log(Level.INFO, "CD-enabled component '${definition.name}' in repository '${definition.github}'") | |
definitions.add(definition) |
cd.enabled
, it seems from Lines 222 to 236 in fe278d5
cdEnabledComponentsByGitHub.each { githubRepo, components -> | |
def groupName = ArtifactoryAPI.getInstance().toGeneratedGroupName(githubRepo) | |
File outputFile = new File(new File(apiOutputDir, 'groups'), groupName + '.json') | |
JsonBuilder json = new JsonBuilder() | |
json { | |
name groupName | |
description "CD group with permissions to deploy from ${githubRepo}" | |
} | |
String pretty = json.toPrettyString() | |
outputFile.parentFile.mkdirs() | |
outputFile.text = pretty | |
} |
Line 247 in fe278d5
cdRepos(cdEnabledComponentsByGitHub.keySet().toList()) |
Line 61 in fe278d5
Map<String, List<Definition>> cdEnabledComponentsByGitHub = new TreeMap<>() |
TreeSet<String>
.
Looking at the API: We're assigning the group to the special user that gets created which has an includes pattern. As far as I can tell that include pattern will not be applied to the right paths unless I'm understanding wrong |
I think it's a last one wins sort of thing from reading it, the group name for each will be normalised to the same group as it's keyed off the GitHub repo, but the paths that are used will likely be the last one Line 155 in fe278d5
|
My reading of Lines 208 to 209 in 5824223
permissions/*.json output.
|
ah possibly, we can try it anyway. |
$ (mvn -DskipTests package && java -DdryRun=true -DdefinitionsDir=$PWD/permissions -DartifactoryApiTempDir=$PWD/json -DartifactoryUserNamesJsonListUrl=https://reports.jenkins.io/artifactory-ldap-users-report.json -Djava.util.logging.SimpleFormatter.format="%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS %4$s: %5$s%6$s%n" -jar target/repository-permissions-updater-*-bin/repository-permissions-updater-*.jar) 2>&1 | fgrep plugin-compat-tester
2021-09-28 19:58:04.293+0000 [id=1] INFO o.c.g.r.c.PojoMetaMethodSite$PojoCachedMethodSiteNoUnwrap#invoke: CD-enabled component 'plugins-compat-tester-cli' in repository 'jenkinsci/plugin-compat-tester'
2021-09-28 19:58:04.435+0000 [id=1] INFO o.c.g.r.c.PojoMetaMethodSite$PojoCachedMethodSiteNoUnwrap#invoke: CD-enabled component 'plugins-compat-tester' in repository 'jenkinsci/plugin-compat-tester'
2021-09-28 19:58:04.658+0000 [id=1] INFO o.c.g.r.c.PojoMetaMethodSite$PojoCachedMethodSiteNoUnwrap#invoke: CD-enabled component 'plugins-compat-tester-aggregator' in repository 'jenkinsci/plugin-compat-tester'
2021-09-28 19:58:04.826+0000 [id=1] INFO o.c.g.r.c.PojoMetaMethodSite$PojoCachedMethodSiteNoUnwrap#invoke: CD-enabled component 'plugins-compat-tester-model' in repository 'jenkinsci/plugin-compat-tester'
2021-09-28 19:58:05.155+0000 [id=1] INFO o.c.g.r.c.PojoMetaMethodSite$PojoCachedMethodSiteNoUnwrap#invoke: Dry-run mode: Skipping PUT call to https://repo.jenkins-ci.org/api/security/groups/generatedv2-cd-jenkinsci_plugin-compat-tester
2021-09-28 19:58:05.288+0000 [id=1] INFO o.c.g.r.c.PojoMetaMethodSite$PojoCachedMethodSiteNoUnwrap#invoke: Processing repository jenkinsci/plugin-compat-tester for CD
2021-09-28 19:58:05.288+0000 [id=1] INFO o.c.g.r.c.PojoMetaMethodSite$PojoCachedMethodSiteNoUnwrap#invoke: Skipped creation of token for GitHub repo: 'jenkinsci/plugin-compat-tester', Artifactory user: 'CD-for-jenkinsci__plugin-compat-tester', group name: 'generatedv2-cd-jenkinsci_plugin-compat-tester', valid for 14400 seconds |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Want this merged since you’re listed here or wait for someone else?
In "jenkinsci/plugin-compat-tester": [
"org/jenkins-ci/tests/plugins-compat-tester",
"org/jenkins-ci/tests/plugins-compat-tester-aggregator",
"org/jenkins-ci/tests/plugins-compat-tester-cli",
"org/jenkins-ci/tests/plugins-compat-tester-model"
], and "jenkinsci/plugin-compat-tester", and {
"name": "generatedv2-cd-jenkinsci_plugin-compat-tester",
"description": "CD group with permissions to deploy from jenkinsci/plugin-compat-tester"
} and then {
"name": "generatedv2-component-plugins-compat-tester-cli",
"includesPattern": "org/jenkins-ci/tests/plugins-compat-tester-cli/*/plugins-compat-tester-cli-*,org/jenkins-ci/tests/plugins-compat-tester-cli/*/maven-metadata.xml,org/jenkins-ci/tests/plugins-compat-tester-cli/*/maven-metadata.xml.*,org/jenkins-ci/tests/plugins-compat-tester-cli/maven-metadata.xml,org/jenkins-ci/tests/plugins-compat-tester-cli/maven-metadata.xml.*",
"excludesPattern": "",
"repositories": [
"snapshots",
"releases"
],
"principals": {
"users": {
"kwhetstone": [
"w",
"n"
],
"jglick": [
"w",
"n"
],
"andresrc": [
"w",
"n"
],
"rarabaolaza": [
"w",
"n"
],
"oleg_nenashev": [
"w",
"n"
]
},
"groups": {
"generatedv2-cd-jenkinsci_plugin-compat-tester": [
"w",
"n"
]
}
}
} which seems like it should work. I am also tempted to just |
I guess it can be merged, provided that you are able to watch the deployment on trusted CI in case something blows up. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 from me as a maintainer. CD is helpful there
I will try to prep this as soon as I get a moment. |
@@ -3,6 +3,8 @@ name: "plugins-compat-tester-cli" | |||
github: "jenkinsci/plugin-compat-tester" | |||
paths: | |||
- "org/jenkins-ci/tests/plugins-compat-tester-cli" | |||
cd: | |||
enabled: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note jenkinsci/plugin-compat-tester#320 (comment): could perhaps omit CD on the other modules, or if jenkinsci/plugin-compat-tester#320 is merged, simply remove the other modules from RPU altogether (would only ever be install
ed locally).
Description
While working on jenkinsci/bom#659 I realized we are still waiting for some person to
mvn -f plugin-compat-tester release:{prepare,perform}
on occasion, which makes little sense for a developer tool—we should just be able to use whatever is inmaster
.Also I am removing modules unused as of jenkinsci/plugin-compat-tester#193.
CC @imonteroperez as apparent primary maintainer, though only @raul-arabaolaza is listed in RPU for now.
Reviewer checklist (not for requesters!)
$pluginId Developers
team hasAdmin
permissions while granting the access.@daniel-beck
) in this pull request. If an email contact is changed, wait for approval from the security officer.There are IRC Bot commands for it