Skip to content

Jig better config validations#255

Open
dulaj-me wants to merge 3 commits intonextfrom
dulaj/eng-83227-jig-better-config-validations
Open

Jig better config validations#255
dulaj-me wants to merge 3 commits intonextfrom
dulaj/eng-83227-jig-better-config-validations

Conversation

@dulaj-me
Copy link
Contributor

@dulaj-me dulaj-me commented Feb 11, 2026

Before:

❯ jig deploy --tag v0.0.10
ℹ Using existing Dockerfile (not managed by jig)
Building registry.together.xyz/proj_csvnq3lka36nwbncbkkva/sprocket-test-dulaj:v0.0.10
[+] Building 1.1s (16/16) FINISHED                                                                                                                                                                                                                                                                                                                                                              docker:orbstack
 => [internal] load build definition from Dockerfile                                                                                                                                                                                                                                                                                                                                                       0.0s
 => => transferring dockerfile: 487B                                                                                                                                                                                                                                                                                                                                           0.6s
....
....
.... 
 => => writing image sha256:de8713f47cd03c04dbac88a56aaa22b2b1a4446e79b3936b3a3da94c0b72cfdc                                                                                                                                                                                                                                                                                                               0.0s
 => => naming to registry.together.xyz/proj_csvnq3lka36nwbncbkkva/sprocket-test-dulaj:v0.0.10                                                                                                                                                                                                                                                                                                              0.0s
✓ Built
Pushing registry.together.xyz/proj_csvnq3lka36nwbncbkkva/sprocket-test-dulaj:v0.0.10
The push refers to repository [registry.together.xyz/proj_csvnq3lka36nwbncbkkva/sprocket-test-dulaj]
...
...
...
v0.0.10: digest: sha256:06571247a092491962bd88d6a7af6c6f19e513ac7980811d68153f51136a9a67 size: 2410
✓ Pushed
Jig: Failed
Jig: An unexpected error occurred - asdict() should be called on dataclass instances

After:

❯ jig deploy --tag v0.0.10
Configuration error in pyproject.toml [tool.jig.deploy]:
  - autoscaling -> targetValue: Input should be a valid string
  - volume_mounts: Input should be a valid list

@cursor
Copy link

cursor bot commented Feb 11, 2026

You have run out of free Bugbot PR reviews for this billing cycle. This will reset on March 7.

To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

for e in exc.errors():
loc = " -> ".join(str(part) for part in e["loc"])
lines.append(f" - {loc}: {e['msg']}")
return "\n".join(lines)
Copy link
Contributor

Choose a reason for hiding this comment

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

More idiomatic way of doing it with pydantic might be just using the @field_validator on every field: https://docs.pydantic.dev/latest/errors/errors/

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Feels too extreme to have validators for each field. Also didn't want to fully commit to pydantic yet assuming we might move to msgspec

@narasul
Copy link
Contributor

narasul commented Feb 11, 2026

seems it broke the tests

@dulaj-me
Copy link
Contributor Author

seems it broke the tests

Ah Pydantic v1. Will fix

- ImageConfig.copy → copy_files (shadowed BaseModel.copy in Pydantic v1)
- Config._path → config_path, Config._unique_name_tip → unique_name_tip (Pydantic v1 rejects underscore-prefixed fields)
- State._config_dir → config_dir, State._project_name → project_name (same reason)
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