Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ci): add typegen check workflow #7463

Merged

Conversation

rikublock
Copy link
Contributor

@rikublock rikublock commented Dec 19, 2024

Summary

Workflow to check whether the generated frontend types in invokeai/frontend/web/src/services/api/schema.ts match those on the server.

Notes

There still appears to be some non-determinism in the typegen creation process. Depending on the Torch installation (CPU, GPU, etc.), the default value of an InputField may change.

Example: https://github.com/invoke-ai/InvokeAI/blob/main/invokeai/app/invocations/create_denoise_mask.py#L33

DEFAULT_PRECISION = TorchDevice.choose_torch_dtype()

fp32: bool = InputField(
    default=DEFAULT_PRECISION == torch.float32,
    description=FieldDescriptions.fp32,
    ui_order=4,
)

Merge Plan

Related Issues / Discussions

#7394 (comment)

Checklist

  • The PR has a short but descriptive title, suitable for a changelog
  • Tests added / updated (if applicable)
  • Documentation added / updated (if applicable)
  • Updated What's New copy (if doing a release after this PR)

@github-actions github-actions bot added the CI-CD Continuous integration / Continuous delivery label Dec 19, 2024
@rikublock rikublock marked this pull request as ready for review December 19, 2024 13:26
@psychedelicious psychedelicious self-requested a review December 19, 2024 22:42
Copy link
Collaborator

@psychedelicious psychedelicious left a comment

Choose a reason for hiding this comment

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

Awesome, thank you.

And perfect timing! The OpenAPI schema changed with the new FLUX ControlLoRA models, but the TS types weren't updated. In #7462 once I rebased, there were typescript errors. I fixed the issue in the frontend code.

@psychedelicious psychedelicious force-pushed the riku/feat-workflow-typegen-checks branch from bfdb362 to 4901409 Compare December 19, 2024 22:46
@github-actions github-actions bot added python PRs that change python files invocations PRs that change invocations labels Dec 19, 2024
@psychedelicious
Copy link
Collaborator

Doing some tests in #7467 - please do not merge this just yet.

@psychedelicious psychedelicious force-pushed the riku/feat-workflow-typegen-checks branch from f2b8633 to 4901409 Compare December 19, 2024 23:03
@psychedelicious
Copy link
Collaborator

Whoops, I accidentally experimented on your branch, fixed that. Tested - looks good. Thanks!

How I tested:

  • Add a new node without regenerating the TS types.
  • Confirm the new check fails.
  • Regenerate the TS types.
  • Confirm the new check passes

@hipsterusername hipsterusername force-pushed the riku/feat-workflow-typegen-checks branch from 4901409 to 22730be Compare December 20, 2024 00:13
@psychedelicious psychedelicious force-pushed the riku/feat-workflow-typegen-checks branch from 22730be to ec7bd04 Compare December 21, 2024 19:04
@psychedelicious psychedelicious enabled auto-merge (rebase) December 21, 2024 19:05
@psychedelicious psychedelicious merged commit d21506d into invoke-ai:main Dec 21, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI-CD Continuous integration / Continuous delivery invocations PRs that change invocations python PRs that change python files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants