Skip to content

Conversation

@haxtibal
Copy link
Contributor

Add a failing testcase for #2566.

On manage auto-uid,

  • "ROLE: TestCase" will correctly be written back,
  • "ROLE: TestDefinition" will not be written back.

DON'T MERGE: I've set the target branch to stanislaw/node_field_origin so that github shows the correct diff. If you want to merge it, cherry-pick the commit manually or tell me to reset the target branch to main.

stanislaw and others added 3 commits November 23, 2025 18:46
Context: This change is the next step towards generating SPDX-Req-ID and
SPDX-Req-HKey in accordance with the Linux Kernel Requirements Template proposal.

Problem:

- When auto-generating MID and HASH, we want to only rewrite these fields. All
  other fields should stay the same for the SDoc sidecar files.
- The SPDX-Req-HKey calculation algorithm shall include all fields of the
  combined requirement node (sidecar + source code). Exception: MID and hash
  key fields.

Solution:

- The `ManageAutoUIDCommand` has been upgraded to generate
  the `MID/SPDX-Req-ID` (SDoc and sidecar respectively) and `HASH` (SDoc only).
- The `SDocNodeFieldOrigin` field was introduced on the SDocNodeField class
  to enable new code that prevents the source node fields to be written back
  to SDoc files when the `manage autouid` command is invoked.
- The hash calculation procedure was fixed to contain calculating the hash over
  all fields of the merged node, i.e., both the SDoc and sidecar fields. The
  previous implementation was incorrect.
- `RELATION_FIELD` previously was not written by the `SDWriter` class.
  It is implemented now as part of this changeset because otherwise the diff
  expectation in the integration test highlights that this field is not present
  in the output document.

Important notes:

- The `SPDX-Req-HKey` is listed as `Sidecar` in the proposal which means that
  a source node must always have a sidecar if a hash calculation is desired.
  We could further clarify if this is what the ELISA group wants.
On manage auto-uid,
- "ROLE: TestCase" will correctly be written back,
- "ROLE: TestDefinition" will *not* be written back.
@stanislaw stanislaw force-pushed the stanislaw/node_field_origin branch from 36ed096 to c18e9f7 Compare November 26, 2025 19:57
@stanislaw
Copy link
Collaborator

This should be fixed by #2577.

@stanislaw stanislaw closed this Nov 26, 2025
@stanislaw stanislaw changed the title Add failing testcase for MID/HASH generation: ROLE not written back [DISCARDED] Add failing testcase for MID/HASH generation: ROLE not written back Nov 26, 2025
@stanislaw stanislaw added this to the 2025-Q4 milestone Nov 26, 2025
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