Skip to content

Commit db0c4d7

Browse files
authored
Merge branch 'OpenJobDescription:mainline' into type_fix
2 parents 60d6ea2 + e5d1755 commit db0c4d7

28 files changed

Lines changed: 954 additions & 166 deletions

.github/workflows/code_quality.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ on:
88
branch:
99
required: false
1010
type: string
11+
tag:
12+
required: false
13+
type: string
1114

1215
jobs:
1316
Test:
@@ -20,3 +23,4 @@ jobs:
2023
with:
2124
os: ${{ matrix.os }}
2225
python-version: ${{ matrix.python-version }}
26+
ref: ${{inputs.tag}}

.github/workflows/on_opened_pr.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: On Opened PR
2+
3+
on:
4+
workflow_run:
5+
workflows: ["Record PR"]
6+
types:
7+
- completed
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
get-pr-details:
14+
permissions:
15+
actions: read # download PR artifact
16+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
17+
uses: OpenJobDescription/.github/.github/workflows/reusable_extract_pr_details.yml@mainline
18+
with:
19+
record_pr_workflow_id: ${{ github.event.workflow_run.id }}
20+
artifact_name: "pr-info"
21+
workflow_origin: ${{ github.repository }}
22+
23+
label-pr:
24+
needs: get-pr-details
25+
if: ${{ needs.get-pr-details.outputs.pr_action == 'opened' || needs.get-pr-details.outputs.pr_action == 'reopened' }}
26+
uses: OpenJobDescription/.github/.github/workflows/reusable_label_pr.yml@mainline
27+
with:
28+
pr_number: ${{ needs.get-pr-details.outputs.pr_number }}
29+
label_name: "waiting-on-maintainers"
30+
permissions:
31+
pull-requests: write

.github/workflows/record_pr.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: Record PR
2+
3+
on:
4+
pull_request:
5+
types: [opened, reopened]
6+
7+
jobs:
8+
call-record-workflow:
9+
uses: OpenJobDescription/.github/.github/workflows/reusable_record_pr_details.yml@mainline

.github/workflows/release_bump.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,8 @@ concurrency:
1717
group: release
1818

1919
jobs:
20-
UnitTests:
21-
name: Unit Tests
22-
uses: ./.github/workflows/code_quality.yml
23-
with:
24-
branch: mainline
25-
2620
Bump:
2721
name: Version Bump
28-
needs: UnitTests
2922
uses: OpenJobDescription/.github/.github/workflows/reusable_bump.yml@mainline
3023
secrets: inherit
3124
with:

.github/workflows/release_publish.yml

Lines changed: 51 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,81 @@
11
name: "Release: Publish"
2-
run-name: "Release: ${{ github.event.head_commit.message }}"
2+
run-name: "Release: ${{ github.event.head_commit.message || inputs.tag }}"
33

44
on:
55
push:
66
branches:
77
- mainline
88
paths:
99
- CHANGELOG.md
10+
workflow_dispatch:
11+
inputs:
12+
tag:
13+
required: true
14+
type: string
15+
description: Specify a tag to re-run a release.
1016

1117
concurrency:
1218
group: release
1319

20+
permissions:
21+
contents: read
22+
1423
jobs:
24+
TagRelease:
25+
uses: OpenJobDescription/.github/.github/workflows/reusable_tag_release.yml@mainline
26+
secrets: inherit
27+
with:
28+
tag: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || '' }}
29+
30+
UnitTests:
31+
name: Unit Tests
32+
needs: TagRelease
33+
uses: ./.github/workflows/code_quality.yml
34+
with:
35+
tag: ${{ needs.TagRelease.outputs.tag }}
36+
37+
PreRelease:
38+
needs: [TagRelease, UnitTests]
39+
uses: OpenJobDescription/.github/.github/workflows/reusable_prerelease.yml@mainline
40+
permissions:
41+
id-token: write
42+
contents: write
43+
secrets: inherit
44+
with:
45+
tag: ${{ needs.TagRelease.outputs.tag }}
46+
47+
Release:
48+
needs: [TagRelease, PreRelease]
49+
uses: OpenJobDescription/.github/.github/workflows/reusable_release.yml@mainline
50+
secrets: inherit
51+
permissions:
52+
id-token: write
53+
contents: write
54+
with:
55+
tag: ${{ needs.TagRelease.outputs.tag }}
56+
1557
Publish:
16-
name: Publish Release
58+
needs: [TagRelease, Release]
59+
uses: OpenJobDescription/.github/.github/workflows/reusable_publish_python.yml@mainline
1760
permissions:
1861
id-token: write
19-
contents: write
20-
uses: OpenJobDescription/.github/.github/workflows/reusable_publish.yml@mainline
2162
secrets: inherit
63+
with:
64+
tag: ${{ needs.TagRelease.outputs.tag }}
65+
2266
# PyPI does not support reusable workflows yet
2367
# # See https://github.com/pypi/warehouse/issues/11096
2468
PublishToPyPI:
25-
needs: Publish
69+
needs: [TagRelease, Publish]
2670
runs-on: ubuntu-latest
2771
environment: release
2872
permissions:
2973
id-token: write
3074
steps:
3175
- name: Checkout
32-
uses: actions/checkout@v4
76+
uses: actions/checkout@v5
3377
with:
34-
ref: release
78+
ref: ${{ needs.TagRelease.outputs.tag }}
3579
fetch-depth: 0
3680
- name: Set up Python
3781
uses: actions/setup-python@v5

CHANGELOG.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,36 @@
1+
## 0.8.3 (2025-08-18)
2+
3+
4+
### Features
5+
* Attempting to load use CSafeLoader for faster YAML parsing where available. CSafeLoader can offer 9->11x performance improvements in some cases while still performing the safe loading methods of safe_load (#219) ([`37d3a65`](https://github.com/OpenJobDescription/openjd-model-for-python/commit/37d3a65fe0cfe27473586005f5a22cfc109f891d))
6+
7+
## 0.8.2 (2025-07-08)
8+
9+
10+
11+
### Bug Fixes
12+
* Adding a TypeAdapter cache to fix a performance regression with larger templates. ([`b62a4f1`](https://github.com/OpenJobDescription/openjd-model-for-python/commit/b62a4f133b33bbea13da2f9dbb97e33441ffe8ca))
13+
14+
## 0.8.1 (2025-06-30)
15+
16+
17+
### Features
18+
* Exposing ExtensionName publicy (#200) ([`0a0cb4a`](https://github.com/OpenJobDescription/openjd-model-for-python/commit/0a0cb4acc6d8d70f5419c4f9b49c1a1b56b01b60))
19+
20+
### Bug Fixes
21+
* sdist failed to install (#198) ([`ed30b7f`](https://github.com/OpenJobDescription/openjd-model-for-python/commit/ed30b7f38c8828a6d33969196dc8db7a74894d09))
22+
* EnvironmentActions type was not validated properly (#197) ([`ae69150`](https://github.com/OpenJobDescription/openjd-model-for-python/commit/ae691502f547bd845001c5f10e32175f386cbe96))
23+
24+
## 0.8.0 (2025-05-22)
25+
26+
### BREAKING CHANGES
27+
* Creation of a DynamicConstrainedStr or FormatString now requires a model parsing context, including the Open Job Description revision and any extensions that are enabled. ([`2a8db9d`](https://github.com/OpenJobDescription/openjd-model-for-python/commit/2a8db9d7064715079b3f7160988787c90fa93f0e))
28+
* instantiate_model no longer accepts optional loc and within_field arguments. ([`2a8db9d`](https://github.com/OpenJobDescription/openjd-model-for-python/commit/2a8db9d7064715079b3f7160988787c90fa93f0e))
29+
30+
### Features
31+
* Added extension definition, REDACTED_ENV_VARS, for RFC-0003: Redacted Environment Variables ([`460656a`](https://github.com/OpenJobDescription/openjd-model-for-python/commit/460656aa06d5f9e16b64a8b67f705bc80bdd31dc))
32+
33+
134
## 0.7.0 (2025-03-03)
235

336
### BREAKING CHANGES

DEVELOPMENT.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ from any directory of this repository:
3131
* `hatch build` - To build the installable Python wheel and sdist packages into the `dist/` directory.
3232
* `hatch run test` - To run the PyTest unit tests found in the `test/` directory. See [Testing](#testing).
3333
* `hatch run all:test` - To run the PyTest unit tests against all available supported versions of Python.
34+
* `hatch run benchmark` - To run performance benchmark tests found in the `test/openjd/model/benchmark/` directory.
3435
* `hatch run lint` - To check that the package's formatting adheres to our standards.
3536
* `hatch run fmt` - To automatically reformat all code to adhere to our formatting standards.
3637
* `hatch shell` - Enter a shell environment where you can run the `deadline` command-line directly as it is implemented in your
@@ -94,6 +95,17 @@ You can run tests with:
9495
Any arguments that you add to these commands are passed through to PyTest. So, if you want to, say, run the
9596
[Python debugger](https://docs.python.org/3/library/pdb.html) to investigate a test failure then you can run: `hatch run test --pdb`
9697

98+
### Running Benchmarks
99+
100+
Performance benchmark tests are kept separate from the regular test suite and can be run with:
101+
102+
* `hatch run benchmark` - To run all benchmark tests.
103+
* `hatch run benchmark -k <benchmark>` - To run a specific benchmark test.
104+
105+
Benchmarks are designed to measure performance characteristics of the library and may take longer to run than regular tests.
106+
107+
Benchmarks may include log output which can be enabled following the instructions in the test output section below.
108+
97109
### Super verbose test output
98110

99111
If you find that you need much more information from a failing test (say you're debugging a

README.md

Lines changed: 1 addition & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -289,105 +289,7 @@ You can download this package from:
289289

290290
### Verifying GitHub Releases
291291

292-
You can verify the authenticity of the release artifacts using the `gpg` command line tool.
293-
294-
1) Download the desired release artifacts from the GitHub releases page. Make sure to download the corresponding PGP signature file (ending with `.sig`) as well.
295-
For example, if you would like to verify your download of the wheel for version `1.2.3`, you should have the following files downloaded:
296-
```
297-
openjd_model-1.2.3-py3-none-any.whl
298-
openjd_model-1.2.3-py3-none-any.whl.sig
299-
```
300-
301-
2) Install the `gpg` command line tool. The installation process varies by operating system. Please refer to the GnuPG website for instructions: https://gnupg.org/download/
302-
303-
3) Save the following contents to a file called `openjobdescription-pgp.asc`:
304-
```
305-
-----BEGIN PGP PUBLIC KEY BLOCK-----
306-
307-
mQINBGXGjx0BEACdChrQ/nch2aYGJ4fxHNQwlPE42jeHECqTdlc1V/mug+7qN7Pc
308-
C4NQk4t68Y72WX/NG49gRfpAxPlSeNt18c3vJ9/sWTukmonWYGK0jQGnDWjuVgFT
309-
XtvJAAQBFilQXN8h779Th2lEuD4bQX+mGB7l60Xvh7vIehE3C4Srbp6KJXskPLPo
310-
dz/dx7a+GXRiyYCYbGX4JziXSjQZRc0tIaxLn/GDm7VnXpdHcUk3qJitree61oC8
311-
agtRHCH5s56E8wt8fXzyStElMkFIZsoLDlLp5lFqT81En9ho/+K6RLBkIj0mC8G7
312-
BafpHKlxkrIgNK3pWACL93GE6xihqwkZMCAeqloVvkOTdfAKDHuD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roxiNtL9gzVXzqpw6qPEsH9hsws
329-
HsPEQWXHmDQvFTNUU14qic1Vc5fyxCBXIAGAPBd20b+219XznJ5uBKUgtvnqcItj
330-
nMYe6Btxh+pjrTA15X/p81z6sB7dkL1hPHfawLhCEzJbIPyyBTQYqY00/ap4Rj7t
331-
kzSiyzBejniFfAZ6eYBWsej7uXUsVndBF1ggZynPTeE=
332-
=iaEm
333-
-----END PGP PUBLIC KEY BLOCK-----
334-
```
335-
336-
4) Import the OpenPGP key for Open Job Description by running the following command:
337-
338-
```
339-
gpg --import --armor openjobdescription-pgp.asc
340-
```
341-
342-
5) Determine whether to trust the OpenPGP key. Some factors to consider when deciding whether or not to trust the above key are:
343-
344-
- The internet connection you’ve used to obtain the GPG key from this website is secure
345-
- The device that you are accessing this website on is secure
346-
347-
If you have decided to trust the OpenPGP key, then edit the key to trust with `gpg` like the following example:
348-
```
349-
$ gpg --edit-key A2F0F059BCC40987
350-
gpg (GnuPG) 2.0.22; Copyright (C) 2013 Free Software Foundation, Inc.
351-
This is free software: you are free to change and redistribute it.
352-
There is NO WARRANTY, to the extent permitted by law.
353-
354-
355-
pub 4096R/BCC40987 created: 2024-02-09 expires: 2026-02-08 usage: SCEA
356-
trust: unknown validity: unknown
357-
[ unknown] (1). Open Job Description <openjobdescription@amazon.com>
358-
359-
gpg> trust
360-
pub 4096R/BCC40987 created: 2024-02-09 expires: 2026-02-08 usage: SCEA
361-
trust: unknown validity: unknown
362-
[ unknown] (1). Open Job Description <openjobdescription@amazon.com>
363-
364-
Please decide how far you trust this user to correctly verify other users' keys
365-
(by looking at passports, checking fingerprints from different sources, etc.)
366-
367-
1 = I don't know or won't say
368-
2 = I do NOT trust
369-
3 = I trust marginally
370-
4 = I trust fully
371-
5 = I trust ultimately
372-
m = back to the main menu
373-
374-
Your decision? 5
375-
Do you really want to set this key to ultimate trust? (y/N) y
376-
377-
pub 4096R/BCC40987 created: 2024-02-09 expires: 2026-02-08 usage: SCEA
378-
trust: ultimate validity: unknown
379-
[ unknown] (1). Open Job Description <openjobdescription@amazon.com>
380-
Please note that the shown key validity is not necessarily correct
381-
unless you restart the program.
382-
383-
gpg> quit
384-
```
385-
386-
6) Verify the signature of the Open Job Description release via `gpg --verify`. The command for verifying the example files from step 1 would be:
387-
388-
```
389-
gpg --verify ./openjd_model-1.2.3-py3-none-any.whl.sig ./openjd_model-1.2.3-py3-none-any.whl
390-
```
292+
See [Verifying GitHub Releases](https://github.com/OpenJobDescription/openjd-model-for-python?tab=security-ov-file#verifying-github-releases) for more information.
391293

392294
## Security
393295

hatch.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ pre-install-commands = [
55

66
[envs.default.scripts]
77
sync = "pip install -r requirements-testing.txt"
8-
test = "pytest --cov-config pyproject.toml {args:test}"
8+
test = "pytest test/ --cov-config pyproject.toml --ignore=test/openjd/model/benchmark {args}"
9+
benchmark = "pytest test/openjd/model/benchmark --no-cov {args}"
910
typing = "mypy {args:src test}"
1011
style = [
1112
"ruff check {args:src test}",

pyproject.toml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ Source = "https://github.com/OpenJobDescription/openjd-model-for-python"
4141
artifacts = [
4242
"*_version.py",
4343
]
44-
only-packages = true
4544

4645
[tool.hatch.version]
4746
source = "vcs"
@@ -64,11 +63,9 @@ destinations = [
6463
]
6564

6665
[tool.hatch.build.targets.sdist]
67-
packages = [
68-
"src/openjd",
69-
]
70-
only-include = [
66+
include = [
7167
"src/openjd",
68+
"hatch_version_hook.py"
7269
]
7370

7471
[tool.hatch.build.targets.wheel]
@@ -133,7 +130,6 @@ addopts = [
133130
"--timeout=30"
134131
]
135132

136-
137133
[tool.coverage.run]
138134
branch = true
139135
parallel = true
@@ -152,6 +148,7 @@ fail_under = 94
152148
# Can be removed or set to true once we are v1
153149
major_on_zero = false
154150
tag_format = "{version}"
151+
allow_zero_version = true
155152

156153
[tool.semantic_release.commit_parser_options]
157154
allowed_tags = [

0 commit comments

Comments
 (0)