You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "davsclaus (via GitHub)" <gi...@apache.org> on 2026/10/16 16:17:41 UTC

[PR] CAMEL-25400: camel-jbang - One sort, one row copy and one format for the listings [camel]

davsclaus opened a new pull request, #27961:
URL: https://github.com/apache/camel/pull/27961

   Second part of [CAMEL-25400](https://issues.apache.org/jira/browse/CAMEL-25400) (tech debt cleanup of the CLI, follow-up of [CAMEL-25388](https://issues.apache.org/jira/browse/CAMEL-25388)): the boilerplate the listings copied from each other.
   
   ### One sort for the listings
   - 48 commands had their own copy of `sortRow` (parse `--sort`, a `-` in front reverses, a `switch` per key, the same `pid`/`name`/`age` cases in 30 of them). `RowSort` gives each listing its order once, such as `RowSort.<Row> integration(r -> r.pid, r -> r.name, r -> r.uptime).number("total", r -> r.total)`.
   - A row without the value of the key comes first (`name` compared without a null check, for example).
   - An unknown key, such as `camel ps --sort=nmae`, exits `2` and lists the keys of the listing; it left the rows unsorted.
   - The top commands (`camel top route`, `processor`, `group`) add the slowest first to the order of their status command, through an `order()` method.
   - `camel version list` and the catalog listings use it too; `camel top source` has no `--sort` and keeps its order (the slowest first).
   - Two keys the help offered did nothing: `camel get bean --sort=type` sorts by type now, and `camel get transformer` no longer offers `total` (transformers have no total).
   
   ### One copy of a row
   - `CopyableRow` replaces the 18 copies of `Row.copy()` (a `clone()` with the same try/catch), used to make the rows of the routes, consumers or errors of an integration from its row.
   
   ### One format
   - `ListingFormat` replaces the copies of the short endpoint URI (5), since last (4), delta (4) and load (3) helpers, and the slowest-first order of the top commands (3).
   
   ### Docs
   - 4.24 upgrade guide: "an unknown sort key is a usage error".
   
   ### Tests
   - `RowSortTest`: by pid as a number, by name ignoring case, by age, reversed, a missing value first, an alias, no sort, an unknown key (exit 2).
   - `ListingFormatTest`: short URI, since last, delta, load, slowest first.
   - `SortOptionsTest`: walks the commands, and checks that the default and the completion values of every `--sort` are keys of the order of its command (it found `camel cmd stub --sort=name`, the default, missing after the conversion, and the two keys above).
   - `ListProcessTest`: `camel ps --sort=nmae` exits 2; `CatalogKameletTest` sorts with the order of the command, and its unknown key is a usage error.
   - `mvn test` of camel-jbang-core and camel-jbang-plugin-tui: all tests pass; camel-jbang-plugin-kubernetes compiles.
   
   _Claude Code on behalf of davsclaus_
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   
   https://claude.ai/code/session_01DDRLJAyf8cDXSg8iX785My
   


-- 
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: commits-unsubscribe@camel.apache.org

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


Re: [PR] CAMEL-25400: camel-jbang - One sort, one row copy and one format for the listings [camel]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #27961:
URL: https://github.com/apache/camel/pull/27961#issuecomment-6220391098

   <!-- ci-tested-modules -->
   :test_tube: **CI tested the following changed modules:**
   
   - `docs`
   - `dsl/camel-jbang/camel-jbang-core`
   
   ---
   
   <details><summary>:microscope: Scalpel shadow comparison — Scalpel: 5 of 706 tested, 8 compile-only — current: 5 all tested</summary>
   
   [Maveniverse Scalpel](https://github.com/maveniverse/scalpel) detected **5 affected modules** (current approach: 5).
   
   **Skip-tests mode would test 5 modules** (2 direct + 5 downstream), **skip tests for 8** (generated code, meta-modules)
   
   <details><summary>Modules Scalpel would test (5)</summary>
   
   - `camel-jbang-mcp` ← downstream of org.apache.camel:camel-jbang-core
   - `camel-jbang-plugin-mcp` ← downstream of org.apache.camel:camel-jbang-core
   - `camel-jbang-plugin-tui` ← downstream of org.apache.camel:camel-jbang-core
   - `camel-jbang-plugin-validate` ← downstream of org.apache.camel:camel-jbang-core
   - `camel-launcher-container` ← downstream of org.apache.camel:camel-launcher
   
   </details>
   
   <details><summary>Modules with tests skipped (8)</summary>
   
   - `camel-jbang-it`
   - `camel-jbang-main`
   - `camel-jbang-plugin-edit`
   - `camel-jbang-plugin-generate`
   - `camel-jbang-plugin-kubernetes`
   - `camel-jbang-plugin-test`
   - `camel-launcher`
   - `coverage`
   
   </details>
   
   > :information_source: Shadow mode — Scalpel observes but does not affect test execution. [Learn more](https://github.com/maveniverse/scalpel)
   
   </details>
   
   :warning: **Some tests are disabled on GitHub Actions** (`@DisabledIfSystemProperty(named = "ci.env.name")`) and require manual verification:
   
   - `dsl/camel-jbang/camel-jbang-core`: 2 test(s) disabled on GitHub Actions
   
   :bulb: **Manual integration tests recommended:**
   
   > You modified `dsl/camel-jbang/camel-jbang-core`. The related integration tests in `dsl/camel-jbang/camel-jbang-it` are excluded from CI. Consider running them manually:
   > ```
   > mvn verify -f dsl/camel-jbang/camel-jbang-it -Djbang-it-test
   > ```
   
   <details><summary>All tested modules (15 modules, 2m 30s total)</summary>
   
   **Total reactor time:** 2m 30s
   
   | Module | Duration | Status |
   | --- | --- | --- |
   | Camel :: Launcher | 38.9s | SUCCESS |
   | Camel :: JBang :: MCP | 36.3s | SUCCESS |
   | Camel :: JBang :: Plugin :: Validate | 30.6s | SUCCESS |
   | Camel :: Docs | 16.6s | SUCCESS |
   | Camel :: JBang :: Plugin :: Kubernetes | 11.3s | SUCCESS |
   | Camel :: JBang :: Plugin :: Testing | 8.8s | SUCCESS |
   | Camel :: JBang :: Plugin :: Edit | 1.5s | SUCCESS |
   | Camel :: Coverage | 1.4s | SUCCESS |
   | Camel :: JBang :: Plugin :: MCP | 1.3s | SUCCESS |
   | Camel :: JBang :: Integration tests | 1.2s | SUCCESS |
   | Camel :: JBang :: Plugin :: Generate | 1.1s | SUCCESS |
   | Camel :: JBang :: Main | 0.7s | SUCCESS |
   | Camel :: Launcher :: Container | 0.6s | SUCCESS |
   | Camel :: JBang :: Core | n/a |  |
   | Camel :: JBang :: Plugin :: TUI | n/a |  |
   
   **Top 20 slowest modules:**
   - `Camel :: Launcher` (38.9s)
   - `Camel :: JBang :: MCP` (36.3s)
   - `Camel :: JBang :: Plugin :: Validate` (30.6s)
   - `Camel :: Docs` (16.6s)
   - `Camel :: JBang :: Plugin :: Kubernetes` (11.3s)
   - `Camel :: JBang :: Plugin :: Testing` (8.8s)
   - `Camel :: JBang :: Plugin :: Edit` (1.5s)
   - `Camel :: Coverage` (1.4s)
   - `Camel :: JBang :: Plugin :: MCP` (1.3s)
   - `Camel :: JBang :: Integration tests` (1.2s)
   - `Camel :: JBang :: Plugin :: Generate` (1.1s)
   - `Camel :: JBang :: Main` (0.7s)
   - `Camel :: Launcher :: Container` (0.6s)
   
   </details>
   
   ---
   :gear: [View full build and test results](https://github.com/apache/camel/actions/runs/38930804939)


-- 
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: commits-unsubscribe@camel.apache.org

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


Re: [PR] CAMEL-25400: camel-jbang - One sort, one row copy and one format for the listings [camel]

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus merged PR #27961:
URL: https://github.com/apache/camel/pull/27961


-- 
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: commits-unsubscribe@camel.apache.org

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


Re: [PR] CAMEL-25400: camel-jbang - One sort, one row copy and one format for the listings [camel]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #27961:
URL: https://github.com/apache/camel/pull/27961#issuecomment-6219799000

   :star2: Thank you for your contribution to the Apache Camel project! :star2:
     :robot: CI automation will test this PR automatically.
   
     :camel: Apache Camel Committers, please review the following items:
   
     * First-time contributors **require MANUAL approval** for the GitHub Actions to run
     * You can use the command `/component-test (camel-)component-name1 (camel-)component-name2..` to request a test from the test bot although they are normally detected and executed by CI.
     * You can label PRs using `skip-tests` and `test-dependents` to fine-tune the checks executed by this PR.
     * Build and test logs are available in the summary page. **Only** [Apache Camel committers](https://camel.apache.org/community/team/#committers) have access to the summary.
     
     :warning: Be careful when sharing logs. Review their contents before sharing them publicly.


-- 
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: commits-unsubscribe@camel.apache.org

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