Skip to content

Add backward compatibility with Nuke projects not yet migrated in the CLI completion - #663

Open
PaysPlat wants to merge 1 commit into
Fallout-build:developfrom
PaysPlat:bugfix/Fallout-tool-backward-compatibility
Open

PaysPlat wants to merge 1 commit into
Fallout-build:developfrom
PaysPlat:bugfix/Fallout-tool-backward-compatibility

Conversation

@PaysPlat

@PaysPlat PaysPlat commented Aug 28, 2026 •

Copy link
Copy Markdown

PR to fix issue #664

Fallout CLI tool auto-completion shall work with NukeBuild projects.
Today, autocompletion searchs only FalloutBuild property in build.schema.json file,
this PR add support of NukeBuild property

@PaysPlat
PaysPlat requested a review from a team as a code owner August 28, 2026 10:08
@PaysPlat
PaysPlat force-pushed the bugfix/Fallout-tool-backward-compatibility branch from ab0a18c to 88ac776 Compare August 28, 2026 10:09
@PaysPlat
PaysPlat force-pushed the bugfix/Fallout-tool-backward-compatibility branch from 88ac776 to e86791e Compare August 28, 2026 10:09
@ChrisonSimtian

Copy link
Copy Markdown
Collaborator

do you mind adding a little PR description and ideally an issue reference that explains why we need this and what it does?
Merci :-)

@dennisdoomen dennisdoomen left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🔧🤖 No test covers a schema with a NukeBuild definition. Please add one next to TestGetCompletionItemsFromSchema in CompletionUtilityTest.cs.

{
if (!TryGetSchema(rootElement, "FalloutBuild", out var baseSchema) &&
// Backward compatibility with NukeBuild projects not yet migrated
!TryGetSchema(rootElement, "NukeBuild", out baseSchema))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🔧🤖 The negated TryGetSchema chain with the out baseSchema trick is hard to follow. Pick the first of FalloutBuild/NukeBuild found in definitions, then fall back to build.

if (!definitions.TryGetValue("build", out var buildProperties))
{
// legacy build properties not found !
return [];

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🤔🤖 A missing build definition used to throw KeyNotFoundException and now returns nothing silently. Is that intended? If so, say why; the comment on line 81 doesn't.

: []);
}

private static bool TryGetSchema(JsonElement rootElement, string buildPropertyName, out JsonElement baseSchema)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

♻️🤖 TryGetSchema can go: definitions is already a dictionary, so use definitions.TryGetValue(name, out var property).

@dennisdoomen dennisdoomen changed the title CompletionUtility: Add backward compatibility with NukeBuild projects not yet migrated Add backward compatibility with Nuke projects not yet migrated in the CLI completion Oct 3, 2026
@ChrisonSimtian
ChrisonSimtian self-requested a review October 4, 2026 08:27

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working target/vCurrent Targets the current version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants