Skip to content

[MNG-8685] Propagate GitHub Actions debug mode to Maven#2253

Closed
ledoyen wants to merge 1 commit intoapache:masterfrom
ledoyen:feat/propagate-github-debug-mode-to-maven
Closed

[MNG-8685] Propagate GitHub Actions debug mode to Maven#2253
ledoyen wants to merge 1 commit intoapache:masterfrom
ledoyen:feat/propagate-github-debug-mode-to-maven

Conversation

@ledoyen
Copy link

@ledoyen ledoyen commented Apr 11, 2025

When in debug mode, GitHub Actions adds the RUNNER_DEBUG environment variable, cf https://github.com/actions/toolkit/blob/1b1e81526b802d1d641911393281c2fb45ed5f11/packages/core/src/core.ts#L258-L260.

It would be a great improvement for scoped troubleshooting to propagate this option to Maven. The use case is the following:

  • A GitHub Actions workflow fails on a call to mvn
  • We relaunch the failed jobs with the debug mode enabled
  • Maven also displays its debug logs this time 🎉

It felt like such a minor change could avoid a new Jira entry, however I still can create one if you think it's best.


https://issues.apache.org/jira/browse/MNG-8685


Following this checklist to help us incorporate your
contribution quickly and easily:

  • Make sure there is a JIRA issue filed
    for the change (usually before you start working on it). Trivial changes like typos do not
    require a JIRA issue. Your pull request should address just this issue, without
    pulling in other changes.
  • Each commit in the pull request should have a meaningful subject line and body.
  • Format the pull request title like [MNG-XXX] SUMMARY,
    where you replace MNG-XXX and SUMMARY with the appropriate JIRA issue.
  • Also format the first line of the commit message like [MNG-XXX] SUMMARY.
    Best practice is to use the JIRA issue title in both the pull request title and in the first line of the commit message.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Run mvn clean verify to make sure basic checks pass. A more thorough check will
    be performed on your pull request automatically.
  • You have run the Core IT successfully.

If your pull request is about ~20 lines of code you don't need to sign an
Individual Contributor License Agreement if you are unsure
please ask on the developers list.

To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.

When in debug mode, GitHub Actions adds the `RUNNER_DEBUG` environment variable,
cf https://github.com/actions/toolkit/blob/1b1e81526b802d1d641911393281c2fb45ed5f11/packages/core/src/core.ts#L258-L260.

It would be a great improvement for scoped troubleshooting to propagate this option to Maven.
The use case is the following:
* A GitHub Actions workflow fails on a call to `mvn`
* We relaunch the failed jobs with the [debug mode enabled](https://docs.github.com/en/actions/managing-workflow-runs-and-deployments/managing-workflow-runs/re-running-workflows-and-jobs#about-re-running-workflows-and-jobs)
* Maven also displays its debug logs this time 🎉

It felt like such a minor change could avoid a new Jira entry, however I still can create one if you think it's best.
@cstamas cstamas changed the title Propagate GitHub Actions debug mode to Maven [MNG-8685] Propagate GitHub Actions debug mode to Maven Apr 11, 2025
@cstamas cstamas added this to the 4.0.0-rc-4 milestone Apr 11, 2025
Copy link
Member

@slawekjaranowski slawekjaranowski left a comment

Choose a reason for hiding this comment

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

Idea is ok, but I would like to implement as possibility to execute

mvn ... --verbose=$ENV_NAME

I would like not add vendor specific name to code

eg, jenkins can have another values

It also will have a impact on out integration tests ....

@pzygielo
Copy link
Contributor

I would like not add vendor specific name to code

Couldn't agree more!

@cstamas
Copy link
Member

cstamas commented Apr 11, 2025

Agreed, there is ther place in core as well:
https://github.com/apache/maven/blob/master/impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/LookupInvoker.java#L938-L941

Maybe we want to pull these out into something like "CIDetector" helpers?

@cstamas
Copy link
Member

cstamas commented Apr 11, 2025

I would like not add vendor specific name to code

Am fine with doing that, but having those encapsulated in some (helper) classes, like Jenkins, GH, etc.... The trick of this PR would be to not have to alter mvn invocation, like we use both: Jenkins and GH, and mvn could really "react" to both.

@cstamas
Copy link
Member

cstamas commented Apr 11, 2025

My alt proposal: #2254

@cstamas
Copy link
Member

cstamas commented Apr 13, 2025

Superseded by #2254

@cstamas cstamas closed this Apr 13, 2025
@slawekjaranowski slawekjaranowski removed this from the 4.0.0-rc-4 milestone Jun 7, 2025
@jira-importer
Copy link

Resolve #9622

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.

5 participants