Skip to content

Add WC3 patch alignment workflow - #83

Merged
Frotty merged 7 commits into
masterfrom
codex/grill-patch-align
Sep 13, 2026
Merged

Frotty merged 7 commits into
masterfrom
codex/grill-patch-align

Conversation

@Frotty

@Frotty Frotty commented Sep 13, 2026

Copy link
Copy Markdown
Member

Summary

  • add read-only grill patch status and explicit grill patch align migration commands
  • detect exact Reforged versions offline from Blizzard's active Warcraft III .build.info row
  • align wc3Patch, the official stdlib branch, and Grill-owned core JASS together while preserving custom stdlib forks
  • pin pre-v3 projects to the preserved wurstStdlib2:v2.0 branch before grill install updates dependencies
  • keep build and typecheck pinned and non-mutating

Acceptance criteria

  • no project mutation when the installed patch matches, cannot be detected exactly, or maps to no supported target
  • a migration backs up wurst.build and updates all patch-coupled project inputs
  • configured executable directories, install roots, Retail, and PTR layouts resolve to the installation root
  • existing v2 and older modern projects cannot accidentally pull v3 stdlib master

Verification

  • ./gradlew.bat test — 88/88 tests passed
  • ./gradlew.bat compileKotlin — passed
  • ./gradlew.bat make_for_userdir — passed
  • packaged grill patch smoke test against WC3 3.0.0.24268 — correctly reported an aligned v3 project
  • git diff --check — clean

Known gaps

  • exact automatic alignment intentionally requires .build.info; older installations without exact metadata remain unchanged and can be selected explicitly during project generation

@Frotty

Frotty commented Sep 13, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 13, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-13T10:30:06.578616Z 3b99df2 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 07218d74c6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/main/kotlin/file/SetupApp.kt Outdated
Comment thread src/main/kotlin/config/WurstProjectConfig.kt
@Frotty

Frotty commented Sep 13, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

💡 Codex Review

handlePatchAlignment(configData)

P2 Badge Avoid repairing config during read-only patch checks

When wurst.build is empty or malformed, this new dispatch path has already called WurstProjectConfig.loadProject; YamlHelper.loadProjectConfig then invokes persistRecoveredConfig, rewriting the file before handlePatchAlignment can report an unavailable or unmappable client version. Consequently, both grill patch and a failed grill patch align can modify the project despite their read-only/no-change guarantees, so patch checks need a non-persisting load path and should defer recovery until alignment can proceed.

AGENTS.md reference: AGENTS.md:L51-L52

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Frotty

Frotty commented Sep 13, 2026

Copy link
Copy Markdown
Member Author

Addressed the round-two read-only loader finding in 0f98099: patch commands now load recovery defaults without persisting them; a successful explicit align may still repair the config. Added regression coverage and reran the full suite.

@Frotty

Frotty commented Sep 13, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

💡 Codex Review

(productIndex < 0 || values.getOrNull(productIndex).equals("w3", ignoreCase = true)) &&
(activeIndex < 0 || values.getOrNull(activeIndex) == "1")

P1 Badge Match the build-info row to the selected client channel

When Retail and PTR coexist and --wc3-path points to _ptr_, executable normalization collapses both channels to the same installation root, but this predicate always selects the first active w3 row without considering the selected executable. It can therefore read the Retail version—or fail to find the PTR product row—and grill patch align may migrate the project to the wrong target or reject a valid PTR installation. Select the .build.info product/branch based on whether the executable came from _retail_ or _ptr_.

AGENTS.md reference: AGENTS.md:L51-L52

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Frotty

Frotty commented Sep 13, 2026

Copy link
Copy Markdown
Member Author

Addressed the round-three Retail/PTR channel finding in 81cb480: detector row selection now carries the chosen executable channel into .build.info (w3 for retail, w3t for ptr). Added coexistence regressions and reran the full suite.

@Frotty

Frotty commented Sep 13, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 81cb480123

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/main/kotlin/file/SetupApp.kt
@Frotty

Frotty commented Sep 13, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: afdeca99bb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/main/kotlin/file/SetupApp.kt Outdated
Comment thread src/main/kotlin/file/Wc3ClientDetector.kt Outdated
@Frotty

Frotty commented Sep 13, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3574699a71

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/main/kotlin/file/SetupApp.kt Outdated
Comment thread src/main/kotlin/file/Wc3ClientDetector.kt Outdated
@Frotty

Frotty commented Sep 13, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3b99df227b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +141 to +144
configData = WurstProjectConfig.loadProject(
configFile,
persistRecovery = setup.command != CLICommand.PATCH
)!!

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Abort alignment when project parsing falls back

When wurst.build is malformed, loadProject(..., false) still returns a synthesized default configuration; because this mode also applies to patch align, a supported client then causes handleUpdate to replace the active configuration with that fallback, discarding dependencies, build metadata, and any custom stdlib fork. The backup makes recovery possible but does not prevent the destructive migration, so alignment should distinguish a parse failure and abort rather than treating the fallback as the project configuration.

AGENTS.md reference: AGENTS.md:L51-L51

Useful? React with 👍 / 👎.

@Frotty
Frotty merged commit 2c676dd into master Sep 13, 2026
1 check passed
@Frotty
Frotty deleted the codex/grill-patch-align branch September 13, 2026 10:31
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.

1 participant