You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Claudenw (via GitHub)" <gi...@apache.org> on 2024/06/12 09:49:19 UTC

[PR] [CLI-336] Deprecation not always reported [commons-cli]

Claudenw opened a new pull request, #284:
URL: https://github.com/apache/commons-cli/pull/284

   fixes for CLI-336 
   
   updated javadoc for OptionGroup.getSelected(), OptionGroup.isSelected() and OptionGroup.select() methods to indicate that deprecated options do not trigger logging of deprecated option usage.
   
   CommandLine methods hasOption(OptionGroup), getOptionValue(OptionGroup), getOptionValues(OptionGroup),  and getParsedOptionValue(OptionGroup) methods.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [CLI-336] Deprecation not always reported [commons-cli]

Posted by "garydgregory (via GitHub)" <gi...@apache.org>.
garydgregory commented on PR #284:
URL: https://github.com/apache/commons-cli/pull/284#issuecomment-2176356452

   @Claudenw
   Good luck 👍  with the move 💪


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [CLI-336] Deprecation not always reported [commons-cli]

Posted by "Claudenw (via GitHub)" <gi...@apache.org>.
Claudenw commented on PR #284:
URL: https://github.com/apache/commons-cli/pull/284#issuecomment-2162589124

   I don't understand how coverage checks can not be met when the added methods are covered based on jacoco report.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [CLI-336] Deprecation not always reported [commons-cli]

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #284:
URL: https://github.com/apache/commons-cli/pull/284#issuecomment-2162591788

   ## [Codecov](https://app.codecov.io/gh/apache/commons-cli/pull/284?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   Attention: Patch coverage is `12.50000%` with `14 lines` in your changes missing coverage. Please review.
   > Project coverage is 94.87%. Comparing base [(`9f6b23b`)](https://app.codecov.io/gh/apache/commons-cli/commit/9f6b23b04d88fef2eaa67607753f3fc82375c52e?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`205d7b8`)](https://app.codecov.io/gh/apache/commons-cli/commit/205d7b8be0a21e4283535be5be47ac20b01ecd25?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   > Report is 223 commits behind head on master.
   
   | [Files](https://app.codecov.io/gh/apache/commons-cli/pull/284?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
   |---|---|---|
   | [.../main/java/org/apache/commons/cli/CommandLine.java](https://app.codecov.io/gh/apache/commons-cli/pull/284?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fapache%2Fcommons%2Fcli%2FCommandLine.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2NvbW1vbnMvY2xpL0NvbW1hbmRMaW5lLmphdmE=) | 12.50% | [13 Missing and 1 partial :warning: ](https://app.codecov.io/gh/apache/commons-cli/pull/284?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   
   <details><summary>Additional details and impacted files</summary>
   
   
   ```diff
   @@             Coverage Diff              @@
   ##             master     #284      +/-   ##
   ============================================
   + Coverage     91.90%   94.87%   +2.97%     
   - Complexity      575      661      +86     
   ============================================
     Files            22       23       +1     
     Lines          1247     1386     +139     
     Branches        210      227      +17     
   ============================================
   + Hits           1146     1315     +169     
   + Misses           63       38      -25     
   + Partials         38       33       -5     
   ```
   
   
   
   </details>
   
   [:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/commons-cli/pull/284?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [CLI-336] Deprecation not always reported [commons-cli]

Posted by "garydgregory (via GitHub)" <gi...@apache.org>.
garydgregory commented on PR #284:
URL: https://github.com/apache/commons-cli/pull/284#issuecomment-2165722143

   @Claudenw ping
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [CLI-336] Deprecation not always reported [commons-cli]

Posted by "garydgregory (via GitHub)" <gi...@apache.org>.
garydgregory commented on code in PR #284:
URL: https://github.com/apache/commons-cli/pull/284#discussion_r1636339569


##########
src/main/java/org/apache/commons/cli/CommandLine.java:
##########
@@ -348,6 +348,44 @@ public String getOptionValue(final Option option, final Supplier<String> default
         return answer != null ? answer : get(defaultValue);
     }
 
+    /**
+     * Gets the first argument, if any, of this option group.
+     *
+     * @param optionGroup the option group.
+     * @return Value of the argument if option group is selected, and has an argument, otherwise null.
+     * @since 1.9.0
+     */
+    public String getOptionValue(final OptionGroup optionGroup) {
+        final String[] values = getOptionValues(optionGroup);
+        return values == null ? null : values[0];

Review Comment:
   Is it possible for the array to be empty?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [CLI-336] Deprecation not always reported [commons-cli]

Posted by "garydgregory (via GitHub)" <gi...@apache.org>.
garydgregory commented on PR #284:
URL: https://github.com/apache/commons-cli/pull/284#issuecomment-2162857444

   > I don't understand how coverage checks can not be met when the added methods are covered based on jacoco report.
   
   @Claudenw 
   
   You are NOT testing ALL of the new APIs added in this PR.
   
   Run:
   
   ```
   mvn clean install site -P jacoco -Dcommons.jacoco.haltOnFailure=false
   ```
   
   Then open `target/site/jacoco` and navigate to `CommandLine` and the untested code will be marked in red.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [CLI-336] Deprecation not always reported [commons-cli]

Posted by "aherbert (via GitHub)" <gi...@apache.org>.
aherbert commented on PR #284:
URL: https://github.com/apache/commons-cli/pull/284#issuecomment-2162658448

   Codecov is currently broken. Uploads now require an authentication token for the master branch, but apparently not for PR branches. The master build codecov upload failed, see [last CI build](https://github.com/apache/commons-cli/actions/runs/9470109685/job/26090266928). So although the codecov uploaded from this PR, there is no record for the base commit and codecov errors with missing coverage.
   
   There is a ticket to resolve this by adding a token to all commons repos: [INFRA-25729](https://issues.apache.org/jira/browse/INFRA-25729). However generating an org level token requires an org level github account and apache does not have one. So this is an unresolved issue.
   
   It may require a move away from codecov to some other tool, or negotiation with codecov to provide an alternative authentication mechanism for open source repos.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [CLI-336] Deprecation not always reported [commons-cli]

Posted by "Claudenw (via GitHub)" <gi...@apache.org>.
Claudenw commented on PR #284:
URL: https://github.com/apache/commons-cli/pull/284#issuecomment-2176303412

   I am traveling and moving over thenext two weeks.  I hope to get to this later this week, time permitting.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org