Skip to content

fix: ComponentVariableYAML.Proto panics on unconvertible value, aborting the whole project parse#9702

Merged
nishantmonu51 merged 1 commit into
mainfrom
nishant/fix-component-parser-panic
Jul 20, 2026
Merged

fix: ComponentVariableYAML.Proto panics on unconvertible value, aborting the whole project parse#9702
nishantmonu51 merged 1 commit into
mainfrom
nishant/fix-component-parser-panic

Conversation

@nishantmonu51

@nishantmonu51 nishantmonu51 commented Jul 19, 2026

Copy link
Copy Markdown
Collaborator
  • ComponentVariableYAML.Proto() panicked when a component or canvas input variable had a value: that structpb.NewValue cannot convert. Since there is no recover() in the parser, a single bad value: in one file aborted the entire project parse.
  • The most likely trigger is a bare date default like value: 2024-01-01, which yaml.v3 decodes into a time.Time.
  • The value is now converted with pbutil.ToValue, which handles time.Time (and other YAML-decoded types), so date defaults now work. Any remaining conversion error is returned as a normal parse error scoped to the file.
  • Added a regression test (TestComponentInputDateValue) covering the panic trigger.

Manual testing steps:

  1. Start Rill Developer (rill start) on any working project.
  2. Create components/panic-test.yaml with:
    type: component
    markdown:
      content: "hello"
    input:
      - name: start
        value: 2024-01-01
  3. Before this fix: the whole project parse fails; every dashboard and model becomes unavailable, and the runtime logs show a recovered panic with invalid type: time.Time from the ProjectParser reconcile.
  4. After this fix: the component parses successfully, with the date default normalized to the string 2024-01-01T00:00:00Z; all other resources keep working.

Checklist:

  • Covered by tests
  • Ran it and it works as intended
  • Reviewed the diff before requesting a review
  • Checked for unhandled edge cases
  • Linked the issues it closes
  • Checked if the docs need to be updated. If so, create a separate Linear DOCS issue
  • Intend to cherry-pick into the release branch
  • I'm proud of this work!

…`value`

A component or canvas input variable with a value that structpb cannot
convert (e.g. a bare date like 2024-01-01, which yaml.v3 decodes to a
time.Time) caused a panic in ComponentVariableYAML.Proto that aborted
the entire project parse.

Convert via pbutil.ToValue, which handles time.Time and other
YAML-decoded types, and return any remaining error as a normal
parse error scoped to the file.
@nishantmonu51

Copy link
Copy Markdown
Collaborator Author

@codex: review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 3bf1665653

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

@nishantmonu51
nishantmonu51 merged commit 22b8278 into main Jul 20, 2026
19 of 20 checks passed
@nishantmonu51
nishantmonu51 deleted the nishant/fix-component-parser-panic branch July 20, 2026 06:06
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.

2 participants