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

added project_id to defined variables #1722

Closed

Conversation

Aditya-PS-05
Copy link

closes #1693

added project_id to defined variables

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

@Aditya-PS-05 Aditya-PS-05 requested a review from a team as a code owner November 7, 2024 07:23
@krisstern krisstern added the enhancement For changelog: Minor enhancement. Use 'major-rfe' for changes to be highlighted label Nov 7, 2024
@krisstern
Copy link
Member

Hi @Aditya-PS-05, it looks like your proposed code changes introduced some unexpected test failures. You may want to check out the JUnit testing we have and see if any adjustment to our existing tests you will need to make.

@Aditya-PS-05
Copy link
Author

@krisstern , try to test with mvn but it's showing errors in pom.xml. Should I create a new issue? Or only it's os specific in my ubuntu22.04 LTS

@krisstern
Copy link
Member

Hi @Aditya-PS-05, could you please share what errors you see regarding pom.xml? Without more info I cannot tell whether the issue is specific to your setup or not.

@krisstern
Copy link
Member

So I have just pulled your code and ran mvn clean verify with it. I don't see any issues with pom.xml though. What Java JDK version are you using?

@Aditya-PS-05
Copy link
Author

When running mvn clean install -X

errors:

[DEBUG] Writing tracking file /home/aditya/.m2/repository/io/jenkins/tools/bom/bom-weekly/3613.v584fca_12cf5c/_remote.repositories
[DEBUG] Writing tracking file /home/aditya/.m2/repository/io/jenkins/tools/bom/bom-weekly/3613.v584fca_12cf5c/bom-weekly-3613.v584fca_12cf5c.pom.lastUpdated
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] Unknown packaging: hpi @ org.jenkins-ci.plugins:gitlab-plugin:${revision}${changelist}, /home/aditya/my-work/open-source/gitlab-plugin/pom.xml, line 13, column 14
 @ 
[ERROR] The build could not read 1 project -> [Help 1]
org.apache.maven.project.ProjectBuildingException: Some problems were encountered while processing the POMs:
[ERROR] Unknown packaging: hpi @ org.jenkins-ci.plugins:gitlab-plugin:${revision}${changelist}, /home/aditya/my-work/open-source/gitlab-plugin/pom.xml, line 13, column 14

    at org.apache.maven.project.DefaultProjectBuilder.build (DefaultProjectBuilder.java:397)
    at org.apache.maven.graph.DefaultGraphBuilder.collectProjects (DefaultGraphBuilder.java:414)
    at org.apache.maven.graph.DefaultGraphBuilder.getProjectsForMavenReactor (DefaultGraphBuilder.java:405)
    at org.apache.maven.graph.DefaultGraphBuilder.build (DefaultGraphBuilder.java:82)
    at org.apache.maven.DefaultMaven.buildGraph (DefaultMaven.java:507)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:219)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.DirectMethodHandleAccessor.invoke (DirectMethodHandleAccessor.java:103)
    at java.lang.reflect.Method.invoke (Method.java:580)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
[ERROR]   
[ERROR]   The project org.jenkins-ci.plugins:gitlab-plugin:1.9.7-SNAPSHOT (/home/aditya/my-work/open-source/gitlab-plugin/pom.xml) has 1 error
[ERROR]     Unknown packaging: hpi @ org.jenkins-ci.plugins:gitlab-plugin:${revision}${changelist}, /home/aditya/my-work/open-source/gitlab-plugin/pom.xml, line 13, column 14
[ERROR] 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException

and when running mvn test

errors

[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] Unknown packaging: hpi @ org.jenkins-ci.plugins:gitlab-plugin:${revision}${changelist}, /home/aditya/my-work/open-source/gitlab-plugin/pom.xml, line 13, column 14
 @ 
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]   
[ERROR]   The project org.jenkins-ci.plugins:gitlab-plugin:1.9.7-SNAPSHOT (/home/aditya/my-work/open-source/gitlab-plugin/pom.xml) has 1 error
[ERROR]     Unknown packaging: hpi @ org.jenkins-ci.plugins:gitlab-plugin:${revision}${changelist}, /home/aditya/my-work/open-source/gitlab-plugin/pom.xml, line 13, column 14
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException

@krisstern
Copy link
Member

Regarding #1722 (comment):

@Aditya-PS-05 Did you try to run mvn clean verify, and which version of Java JDK are you using?

@Aditya-PS-05
Copy link
Author

mvn clean verify

openjdk 21.0.5 2024-10-15 LTS

when running mvn clean verify

res:

aditya@aditya-HP-Laptop-15s-du3xxx:~/my-work/open-source/gitlab-plugin$ mvn clean verify
[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] Unknown packaging: hpi @ org.jenkins-ci.plugins:gitlab-plugin:${revision}${changelist}, /home/aditya/my-work/open-source/gitlab-plugin/pom.xml, line 13, column 14
 @ 
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]   
[ERROR]   The project org.jenkins-ci.plugins:gitlab-plugin:1.9.7-SNAPSHOT (/home/aditya/my-work/open-source/gitlab-plugin/pom.xml) has 1 error
[ERROR]     Unknown packaging: hpi @ org.jenkins-ci.plugins:gitlab-plugin:${revision}${changelist}, /home/aditya/my-work/open-source/gitlab-plugin/pom.xml, line 13, column 14
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:

@krisstern
Copy link
Member

I have checked I don't think it is a pom.xml error, it is more like a local setup issue for you

@krisstern
Copy link
Member

And I am asking this for the 3rd time: Which Java JDK are you using?

@Aditya-PS-05
Copy link
Author

And I am asking this for the 3rd time: Which Java JDK are you using?

Sir, I already answered it

it's OpenJDK 21.0.5 2024-10-15 LTS

@krisstern
Copy link
Member

My apologies you answered right after quoting mvn clean verify without any context so I could not tell you were specifying your Java version. Please be more careful in your replies moving forward. How about if you switch to Java 17 instead? What do you see?

@krisstern
Copy link
Member

And which Maven version are you currently using?

@Aditya-PS-05
Copy link
Author

And which Maven version are you currently using?

Apache Maven 3.6.3

@Aditya-PS-05
Copy link
Author

My apologies you answered right after quoting mvn clean verify without any context so I could not tell you were specifying your Java version. Please be more careful in your replies moving forward. How about if you switch to Java 17 instead? What do you see?

got it

@krisstern
Copy link
Member

@Aditya-PS-05 I think your Maven version is too old. The latest version is 3.9.x. So you may want to download the latest one say from here: https://maven.apache.org/download.cgi.

@@ -115,7 +115,7 @@ public final class CauseData {
this.actionType = Objects.requireNonNull(actionType, "actionType must not be null.");
this.sourceProjectId = Objects.requireNonNull(sourceProjectId, "sourceProjectId must not be null.");
this.targetProjectId = Objects.requireNonNull(targetProjectId, "targetProjectId must not be null.");
this.projectId = Objects.requireNonNull(projectId, "projectId must not be null.");
this.projectId = projectId == null ? 0 : projectId;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
this.projectId = projectId == null ? 0 : projectId;
this.projectId = Objects.requireNonNull(projectId, "projectId must not be null.");

We should not change the original logic for handling the projectId in "src/main/java/com/dabsquared/gitlabjenkins/cause/CauseData.java"

@Aditya-PS-05 Aditya-PS-05 closed this by deleting the head repository Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement For changelog: Minor enhancement. Use 'major-rfe' for changes to be highlighted
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add gitlab project id to defined variable
2 participants