ide-workspace: a project descriptor without an actions section is not an error (#7286) - #7334
Merged
Merged
Conversation
… an error (#7286) A `project.json` that omits the `actions` key is the normal case - every intent-generated project, every sample, every hand-written descriptor that declares only a guid and its dependencies. `ActionsService` logged it at ERROR from both of its read sites, so a single Publish emitted two of these lines (`ProjectActionsPublisherHandler` calls `listRegisteredActions` in `beforePublishProject` and again in `afterPublishProject`), and a CI shard publishing a handful of projects filled the Logs view with them. Nothing had failed and nothing was retried. The message also concatenated the project name instead of using an SLF4J `{}` placeholder. `listRegisteredActions` now says nothing: an empty list is its documented return, and the caller iterates it either way. `executeAction` keeps a line - the caller asked for an action by name - but at `debug`, with a placeholder. Return values are unchanged on both paths. Verified: `ActionsServiceTest#projectWithoutActionsSectionIsNotAnError` is a new regression test that publishes a descriptor without an actions section and asserts the service logs nothing at ERROR; against the unfixed service it fails with both messages captured, and passes with the change. The ide-workspace unit suite is green (35 tests), `mvn -T 1C formatter:validate` is green with the formatter cache wiped, and `CamelDirigibleJavaScriptComponentHttpRouteIT` (a publish-exercising integration test) is green. Fixes #7286 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
| List<ProjectAction> actions = projectJson.getActions(); | ||
| if (actions == null) { | ||
| logger.error("Actions section not found in the project descriptor file: " + project); | ||
| logger.debug("No actions section in the project descriptor file of project [{}]", project); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cause
A
project.jsonthat omits theactionskey is the normal case - every intent-generated project, every sample, every hand-written descriptor that declares only a guid and its dependencies. (A project created through the IDE gets"actions": []fromproject.json_, which is an empty list, not a missing key - so the ones that trip this are exactly the authored and generated descriptors.)ActionsServicelogged that at ERROR from both of its read sites, andProjectActionsPublisherHandlerreads them both on every publish -listRegisteredActionsinbeforePublishProjectand again inafterPublishProject- so one Publish of one such project emitted two ERROR lines. Nothing had failed and nothing was retried; an ERROR in the Logs view should mean something went wrong. The message also concatenated the project name instead of using an SLF4J{}placeholder.Change
listRegisteredActionssays nothing at all. An empty list is its documented return and the caller iterates it either way, so there is no event here to report.executeActionkeeps a line - the caller did ask for an action by name - but atdebug, with a placeholder.Return values are unchanged on both paths; this is a logging change only.
Verification
New regression test
ActionsServiceTest#projectWithoutActionsSectionIsNotAnError: creates a descriptor without anactionssection, exercises both read paths, and asserts the service logs nothing at ERROR. Run against the unfixed service it fails with both messages captured -and passes with the change.
mvn -pl components/ide/ide-workspace test- green, 35 tests.mvn -T 1C formatter:validatewith the formatter cache wiped first -BUILD SUCCESS.CamelDirigibleJavaScriptComponentHttpRouteIT(a publish-exercising integration test) - green.Not verified: no Chrome-driven UI IT was run - the local chromedriver does not match the installed Chrome, and the unit test is the direct and permanent witness for a logging change. The repository was grepped for other occurrences of this message shape; the two lines changed here are the only ones.
Fixes #7286
🤖 Generated with Claude Code