Skip to content

Conversation

@lagru
Copy link
Member

@lagru lagru commented Oct 23, 2025

I thought about not doing it this way but then it becomes more complicated to include the stubs into the package in the release workflow cd.yml. I want to keep the release workflow as minimal as possible to reduce the risk of a supply chain attack.

This approach sidesteps that problem, because the stubs are already there and tracked. However, we need to assert that the tracked stubs are identical with the docstub generated ones. That is a bit tricky, because git diff actually ignores untracked files! So I came up with assert-unchanged.sh. I really struggled with this becaue I initally tried to use git ls-files with the "-z" option which returns null-delimited paths. I couldn't figure out how to pass them to git add and git unstage later on.

I'm worried that this approach is a bit brittle (due to assert-unchanged.sh) and increases the diff in PRs. On the other hand being able to review the stubs is probably not a bad thing. We'll see how that goes.

Release note

For maintainers and optionally contributors, please refer to changelist's README on how to document this PR for the release notes.

Include stubs for docstub in the distribution packages.
{label="enhancement"}

I thought about not doing this but then it becomes more complicated
to include the stubs into the package in the release workflow (cd.yml).
I want to keep the release workflow as minimal as possible to reduce
the risk of a supply chain attack.

This approach sidesteps that problem, because the stubs are already
there and tracked. However, we need to assert that the tracked stubs
are identical with the docstub generated ones. That is a bit tricky,
because `git diff` actually ignores untracked files! So I came up with
`assert-unchanged.sh`. I really struggled with this becaue I initally
tried to use git ls-files with the "-z" option which returns
null-delimited paths. I couldn't figure out how to pass them to
`git add` and `git unstage` later on.

I'm worried that this approach is a bit brittle (due to
`assert-unchanged.sh`) and increases the diff in PRs. On the other hand
being able to review the stubs is probably not a bad thing. We'll see
how that goes.
@lagru lagru added this to the v0.5 milestone Oct 23, 2025
@lagru lagru added the maintenance Keeps the lights on label Oct 23, 2025
@lagru lagru added devops Infrastructure, tooling, ... and removed maintenance Keeps the lights on labels Oct 24, 2025
@lagru lagru changed the title Track generated inplace stubs for docstub itself Track generated stubs for docstub itself Oct 24, 2025
@lagru lagru merged commit 34e41f6 into main Oct 24, 2025
8 checks passed
@lagru lagru deleted the track-stubs branch October 24, 2025 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devops Infrastructure, tooling, ...

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants