Skip to content

docs: clarify stepEnvironment name scope; add cross-step same-name fixture - #183

Open
wyongzhi wants to merge 1 commit into
OpenJobDescription:mainlinefrom
wyongzhi:step-env-name-scope
Open

docs: clarify stepEnvironment name scope; add cross-step same-name fixture#183
wyongzhi wants to merge 1 commit into
OpenJobDescription:mainlinefrom
wyongzhi:step-env-name-scope

Conversation

@wyongzhi

Copy link
Copy Markdown
Collaborator

Description of the change. What is being added or fixed?

Wiki (2023-09-Template-Schemas.md), clarification only, no rule change.

Section 3 (StepTemplate.stepEnvironments) lists what a Step Environment name must not collide with: other entries in the same list, and any Job Environment. It does not state that different Steps may reuse a name, and one implementation read that omission as a fourth rule and rejected such templates (OpenJobDescription/openjd-rs#380, fixed in OpenJobDescription/openjd-rs#381). This PR:

  • adds a Note under the Section 3 constraints: a Step Environment's name is scoped to the Step that defines it; different Steps may each define a Step Environment with the same name, since a Session only ever contains one Step's environments.
  • names the two scopes in Section 4 (Environment.name): the Job Template for a Job Environment, the Step Template for a Step Environment.

The set of valid templates is unchanged before and after this wording.

Conformance fixture conformance-tests/2023-09/base/job_templates/4--same-step-env-name-across-steps.yaml (valid): one jobEnvironments entry plus two Steps that each define a Step Environment named StepEnv. The existing Section 4 fixtures cover the three prohibitions (4--duplicate-job-env-names.invalid, 4--duplicate-step-env-names.invalid, step-vs-job); none covers the allowed cross-step case, which is why the over-strict check went unnoticed.

Verified with openjd CLI built from openjd-rs: rejected at upstream/main before the fix (steps[1] -> stepEnvironments[0]: duplicate environment name: 'StepEnv'), accepted on the fix branch; all Section 4 fixtures pass there. Python (openjd-model-for-python) accepts the same shape.

Note for consumers pinning this suite: an implementation without the openjd-rs#381 fix will fail this fixture until it picks up the fix.


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

…xture

Section 3 lists what stepEnvironment names must not collide with (the
same list, and jobEnvironments) but never states that different steps
may reuse a name. One implementation read the omission as a fourth rule
and rejected such templates (openjd-rs #380). Add a note under the
constraints and name the two scopes in section 4. No rule changes.

Add 4--same-step-env-name-across-steps.yaml so the conformance suite
exercises the allowed case; it fails on the over-strict implementation
and passes once fixed.

Signed-off-by: wyongzhi <276409147+wyongzhi@users.noreply.github.com>
@wyongzhi
wyongzhi requested a review from a team as a code owner September 10, 2026 23:26
2. The Environments defined in this list must not have the same `name` as a Job Environment defined in the same
Job Template.
* Note: The scope of a Step Environment's `name` is the Step that defines it. Different Steps may each define a
Step Environment with the same `name`; a Session only ever contains the Step Environments of a single Step, so

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍

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.

3 participants