Skip to content

Conversation

@kanterov
Copy link
Collaborator

@kanterov kanterov commented Apr 4, 2025

Changes

Update Python code from the latest json schema.

Rename jobs.Permission into jobs.JobPermission to avoid confusion, following the spec.

Annotate features in a preview with "EXPERIMENTAL" and exclude them from the documentation.

@kanterov kanterov temporarily deployed to test-trigger-is April 4, 2025 12:43 — with GitHub Actions Inactive
@kanterov kanterov force-pushed the update-jobs-python branch from 4587e10 to aa3321c Compare April 4, 2025 12:54
@kanterov kanterov temporarily deployed to test-trigger-is April 4, 2025 12:54 — with GitHub Actions Inactive
@kanterov kanterov force-pushed the update-jobs-python branch from aa3321c to 2ce841e Compare April 4, 2025 13:21
@kanterov kanterov temporarily deployed to test-trigger-is April 4, 2025 13:21 — with GitHub Actions Inactive
@kanterov kanterov marked this pull request as ready for review April 4, 2025 13:22
@kanterov kanterov requested a review from lennartkats-db April 4, 2025 13:23
"JobParameterDefinition",
"JobParameterDefinitionDict",
"JobParameterDefinitionParam",
"JobPermission",
Copy link
Contributor

Choose a reason for hiding this comment

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

From your summary:

Rename jobs.Permission into jobs.JobPermission to avoid confusion, following the spec.

I don't fully understand the mechanics here yet, how is this generated? And is there a README covering that for maintainers somewhere?

Copy link
Collaborator Author

@kanterov kanterov Apr 7, 2025

Choose a reason for hiding this comment

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

JobPermission is fixed in #2642, I've just generated the code using effective jsonschema

)

if TYPE_CHECKING:
from typing_extensions import Self
Copy link
Contributor

Choose a reason for hiding this comment

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

Btw, tangential question, what error do we show for Python <3.11, where things like these extensions are not available?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This branch will be only evaluated by tools like pyright/mypy that comes with typing_extensions. We could have added typing_extensions as a dependency, but we don't need it during runtime.

Copy link
Contributor

Choose a reason for hiding this comment

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

That's fine, this is just a tangential question, but I'm still interested in the answer — what happens if you try to use jobs as code with Python <3.11?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It works, our acceptance tests run with Python 3.10

Copy link
Contributor

Choose a reason for hiding this comment

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

discussed offline: there's metadata preventing installation for <3.10

@kanterov kanterov requested a review from lennartkats-db April 7, 2025 09:14
Copy link
Contributor

@lennartkats-db lennartkats-db left a comment

Choose a reason for hiding this comment

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

This looks good, but please follow up with READMEs or maintainers!

@lennartkats-db lennartkats-db added this pull request to the merge queue Apr 7, 2025
Merged via the queue into main with commit 973421d Apr 7, 2025
15 checks passed
@lennartkats-db lennartkats-db deleted the update-jobs-python branch April 7, 2025 10:01
Copy link
Contributor

@pietern pietern left a comment

Choose a reason for hiding this comment

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

@kanterov This PR has a dependency on #2642, which is not yet merged.

@kanterov
Copy link
Collaborator Author

kanterov commented Apr 7, 2025

@pietern There is no strong dependency, code generator special-cased JobPermission. To remove special-casing we should update JSON schema

@pietern
Copy link
Contributor

pietern commented Apr 7, 2025

@kanterov But this change doesn't touch the codegen?

@kanterov
Copy link
Collaborator Author

kanterov commented Apr 7, 2025

@pietern because the PR with codegen is still being reviewed

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.

4 participants