Skip to content

Update to pure V json2 module#78

Merged
GGRei merged 7 commits into
vlang:mainfrom
squidink7:json2
Jul 20, 2026
Merged

Update to pure V json2 module#78
GGRei merged 7 commits into
vlang:mainfrom
squidink7:json2

Conversation

@squidink7

@squidink7 squidink7 commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

json is deprecated, replaced by json2 in the latest version of V
This requires tracking V master which means some of the actions need to be updated.

@GGRei

GGRei commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

@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: 64108e85af

ℹ️ 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 theme_bundle.v
Comment thread locale_bundle.v
@GGRei

GGRei commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

@squidink7 Alex has now fixed and merged the escaped-key decoding issue in json2: vlang/v#27815

Please update V first. To finish this PR, the cleanest option is to track the latest V version, keep import json2, update the V 0.5.1 smoke workflow, add a small GUI regression test for escaped locale/theme keys, then resolve both Codex review threads.

Thanks! :)

@squidink7

Copy link
Copy Markdown
Contributor Author

I've added a test, however I'm not familiar with github workflows. Would I just change the V_VERSION env to master?

@GGRei

GGRei commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Not quite. :)

Simply changing V_VERSION to master would make the workflow try to download releases/download/master/v_windows.zip, which does not exist.

Please reuse the latest-V Windows setup already present in .github/workflows/ci.yml: the Resolve V revision, Restore V compiler cache, Install V, and Save V compiler cache steps. This resolves master to an exact commit SHA, builds it with makev.bat, and uses that SHA in the cache keys.

The test you added is close, but it must use a raw V string. Otherwise V converts the Unicode escapes before json2 receives them:

content := r'{"n\u0061me":"esc\u0061ped"}'

Please also add the locale regression case requested by Codex in _locale_bundle_test.v:

content := r'{"str\u0069ngs":{"o\u006b":"OK"}}'

Then parse it and verify:

assert loc.str_ok == 'OK'

Finally, run v fmt on both test files, let CI pass, and resolve the remaining Codex review thread.

Thanks sir! :)

@squidink7

Copy link
Copy Markdown
Contributor Author

Thanks for the feedback! I was wondering if I needed to do something like double escape the string.
I've updated the tests, and while I made an attempt at adjusting the smoke tests it'll likely take a little trial and error before I can get it working. I've never used github actions before so this is new territory.

@GGRei

GGRei commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Thanks.

I noticed one issue in my previous suggestion: "OK" is already the default fallback value, so that assertion cannot prove the escaped key was decoded. That was my mistake. Please use a distinct value such as "ESCAPED_OK_78" in both the JSON and the assertion.

The latest-V Windows smoke setup looks correct. Since this workflow is manual, please open the "Windows Native Smoke" workflow in your fork, click "Run workflow", select the json2 branch, and leave the default options for the first run or run:

gh workflow run windows-native-smoke.yml --repo squidink7/gui --ref json2

Once that smoke and the normal PR CI are green, you can resolve the remaining Codex review thread and let me know. :)

@squidink7

Copy link
Copy Markdown
Contributor Author

Whenever I try to do anything with the GitHub cli it responds with this message:

could not create workflow dispatch event: HTTP 503: No server is currently available to service your request. Sorry about that. Please try resubmitting your request and contact us if the problem persists.

After a few tries I managed to eventually login but running the workflow does that too. Though something must have happened because I got an email saying the NodeJS version is out of date? I didn't think we used Node...

GitHub is weird.

@GGRei

GGRei commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

The workflow was actually dispatched, so the 503 was only transient. I checked the run. The Node.js warning comes from GitHub's actions/cache action.

The actual failure is the restored vglyph cache. It contains an older checkout with local Git commits, so v install vglyph correctly refuses to overwrite it. The workflow needs a small cache-handling fix before the Windows smoke can reach the actual tests.

@squidink7

Copy link
Copy Markdown
Contributor Author

I see, what would be the best approach to fix this?

@GGRei

GGRei commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

The cleanest fix is to reuse the vglyph cache pipeline already present in .github/workflows/ci.yml.

In .github/workflows/windows-native-smoke.yml, apply it to the prewarm-msvc-deps, msvc, and clang jobs:

  1. Add Resolve vglyph revision.
  2. Replace the old vglyph cache block with Restore V module cache.
  3. Remove the broad restore-keys fallback.
  4. Replace v install vglyph with Ensure vglyph revision.
  5. Add Save V module cache after it.

You can copy those four steps directly from ci.yml. They key the cache by the exact V and vglyph revisions and avoid asking VPM to overwrite a restored Git checkout, which caused the failure. The MinGW job can remain unchanged because it does not restore that cache. The Node.js warning is unrelated. Afterward, rerun Windows Native Smoke on the json2 branch.

@GGRei

GGRei commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Thanks! The regular CI is green now. I’m just waiting for your feedback after rerunning the Windows Native Smoke workflow on the latest commit. :)

@squidink7

Copy link
Copy Markdown
Contributor Author

The windows smoke test passed :)

@GGRei

GGRei commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: 2613ef2154

ℹ️ 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".

@GGRei
GGRei merged commit e699bcf into vlang:main Jul 20, 2026
4 checks passed
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.

3 participants