-
Notifications
You must be signed in to change notification settings - Fork 166
[MOSIP-37901]: Exclude mosip services being published to nexus (develop) #1701
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
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -19,6 +19,8 @@ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <properties> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <spring-cloud.version>2023.0.6</spring-cloud.version> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <maven.deploy.plugin.version>3.1.1</maven.deploy.plugin.version> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <central.publishing.maven.plugin.version>0.7.0</central.publishing.maven.plugin.version> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </properties> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <dependencies> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -109,6 +111,45 @@ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </execution> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </executions> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </plugin> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <plugin> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <artifactId>maven-deploy-plugin</artifactId> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <version>${maven.deploy.plugin.version}</version> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <configuration> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <skip>true</skip> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </configuration> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <executions> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <execution> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <id>default-deploy</id> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <phase>none</phase> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <goals> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <goal>deploy</goal> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </goals> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <configuration> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <skip>true</skip> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </configuration> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </execution> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </executions> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </plugin> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+114
to
+132
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "== Inspect external reusable workflow =="
curl -fsSL https://raw.githubusercontent.com/mosip/kattu/master-java21/.github/workflows/maven-publish-to-nexus.yml \
| nl -ba | sed -n '1,260p'
echo
echo "== Find Maven publish command + deploy skip override presence =="
curl -fsSL https://raw.githubusercontent.com/mosip/kattu/master-java21/.github/workflows/maven-publish-to-nexus.yml \
| rg -n "mvn|deploy|central-publishing|maven.deploy.skip|OSSRH_URL|settings.xml"Repository: mosip/esignet Length of output: 188 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "== Fetching external reusable workflow =="
WORKFLOW=$(curl -fsSL https://raw.githubusercontent.com/mosip/kattu/master-java21/.github/workflows/maven-publish-to-nexus.yml)
if [ -z "$WORKFLOW" ]; then
echo "Failed to fetch workflow. Trying alternative path..."
curl -fsSL https://raw.githubusercontent.com/mosip/kattu/refs/heads/master-java21/.github/workflows/maven-publish-to-nexus.yml 2>&1 | head -50
exit 1
fi
echo "$WORKFLOW" | head -100
echo
echo "== Searching for Maven deploy invocations =="
echo "$WORKFLOW" | grep -n "mvn\|deploy\|central-publishing\|maven.deploy\|OSSRH\|settings" || echo "(no matches found)"
echo
echo "== Full workflow content (first 300 lines) =="
echo "$WORKFLOW" | head -300Repository: mosip/esignet Length of output: 10169
The reusable workflow calls To fix, remove both the plugin-level Required fix <plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>${maven.deploy.plugin.version}</version>
- <configuration>
- <skip>true</skip>
- </configuration>
<executions>
<execution>
<id>default-deploy</id>
<phase>none</phase>
<goals>
<goal>deploy</goal>
</goals>
- <configuration>
- <skip>true</skip>
- </configuration>
</execution>
</executions>
</plugin>📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <plugin> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <groupId>org.sonatype.central</groupId> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <artifactId>central-publishing-maven-plugin</artifactId> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <version>${central.publishing.maven.plugin.version}</version> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <extensions>true</extensions> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <executions> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <execution> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <id>default-publish</id> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <phase>none</phase> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <goals> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <goal>publish</goal> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </goals> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </execution> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </executions> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <configuration> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <publishingServerId>ossrh</publishingServerId> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <autoPublish>false</autoPublish> <!-- do NOT auto publish after staging --> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </configuration> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </plugin> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </plugins> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </build> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.
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.
🧩 Analysis chain
🏁 Script executed:
Repository: mosip/esignet
Length of output: 3738
Both publish jobs use
RELEASE_URLwhile allowing SNAPSHOT versions on non-release branches.Line 109 publishes to release URL on any non-master branch (excluding PRs). Line 240 publishes to release URL while explicitly excluding actual release events. With SNAPSHOT versions in the codebase (1.8.0-SNAPSHOT), this risks publishing development builds to production endpoints or failures from release URL rejecting snapshots. Tighten job conditions to gate publish jobs by release context, or use conditional URL selection based on version/branch.
🤖 Prompt for AI Agents
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.
suggest fix?
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.
@NidhiKumari0201, here's a concrete fix. The core problem is:publish_to_nexus_apitest_esignetalready excludes release events in itsif:condition, yet usesRELEASE_URL— so SNAPSHOT artifacts would hit a release endpoint on every develop push.publish_to_nexusruns on non-master non-PR branches (includingdevelopwith SNAPSHOT versions), same issue.Since GitHub Actions doesn't allow conditional secret selection inline in
secrets:blocks of reusable workflow calls, the cleanest approach is to split each publish job into two — one for release, one for snapshots — with appropriate conditions:Summary of the fix:
publish_to_nexusevent == releaseRELEASE_URLpublish_snapshot_to_nexusOSSRH_SNAPSHOT_URLpublish_to_nexus_apitest_esignetevent == releaseRELEASE_URLpublish_snapshot_to_nexus_apitest_esignetOSSRH_SNAPSHOT_URL