Skip to content

Pin one-shot tools - #4283

Open
woodruffw wants to merge 3 commits into
mainfrom
oss-remediation/03-one-shot-pins
Open

woodruffw wants to merge 3 commits into
mainfrom
oss-remediation/03-one-shot-pins

Conversation

@woodruffw

@woodruffw woodruffw commented Aug 16, 2026 •

Copy link
Copy Markdown
Member

Summary

Adds concrete version (and/or hash) pins where appropriate.

Note: I'm pretty sure the ty pins are over-eager here. But maybe Rooster can also auto-update these?

I think I did the Rooster changes correctly...

Test Plan

NFC.


Stack created with GitHub Stacks CLI • Give Feedback 💬

Base automatically changed from oss-remediation/02-uv-audit to main August 16, 2026 20:35
Unresolved: piped standalone installer examples; integrity verification needs installation-docs redesign.
@woodruffw
woodruffw force-pushed the oss-remediation/03-one-shot-pins branch from 7c78a07 to c3eb667 Compare August 16, 2026 20:35
@woodruffw
woodruffw marked this pull request as ready for review August 16, 2026 20:35
Signed-off-by: William Woodruff <[email protected]>
@woodruffw
woodruffw requested a review from AlexWaygood August 16, 2026 20:39
Comment thread Dockerfile
Comment on lines +24 to +35
ARG BUILDARCH
ARG RUSTUP_VERSION=1.28.2
RUN case "$BUILDARCH" in \
"amd64") rustup_target="x86_64-unknown-linux-gnu"; rustup_sha256="20a06e644b0d9bd2fbdbfd52d42540bdde820ea7df86e92e533c073da0cdd43c" ;; \
"arm64") rustup_target="aarch64-unknown-linux-gnu"; rustup_sha256="e3853c5a252fca15252d07cb23a1bdd9377a8c6f3efa01531109281ae47f841c" ;; \
*) exit 1 ;; \
esac && \
curl --proto '=https' --tlsv1.2 -sSf "https://static.rust-lang.org/rustup/archive/${RUSTUP_VERSION}/${rustup_target}/rustup-init" -o /tmp/rustup-init && \
echo "${rustup_sha256} /tmp/rustup-init" | sha256sum -c - && \
chmod +x /tmp/rustup-init && \
/tmp/rustup-init -y --target "$(cat rust_target.txt)" --profile minimal --default-toolchain none && \
rm /tmp/rustup-init

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I can't say I love this...maybe there's a first-party Rust image we can hash-pin to instead? I'm not sure if that's better.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We should make this change separately, it's way more sensitive than pinning one-off uvx invocations.

@zanieb zanieb Aug 16, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Also, we should match across our repositories, e.g., this file is already drifting from uv https://github.com/astral-sh/uv/blob/main/Dockerfile

Comment thread .github/workflows/ci.yaml

- name: "Build docs"
run: uvx --with-requirements docs/requirements.txt mkdocs build --strict -f mkdocs.yml
run: uvx --from "mkdocs==1.6.0" --with-requirements docs/requirements.txt mkdocs build --strict -f mkdocs.yml

@AlexWaygood AlexWaygood Aug 16, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'd suggest pinning mkdocs as a dev-dependency in pyproject.toml and then changing this to uv run --only-group=dev --locked

@AlexWaygood AlexWaygood Aug 16, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looking more closely, possibly we should convert the whole docs/requirements.txt file into a docs dependency group in pyproject.toml

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

my pattern for this is having the dev group defined as tests + docs + lint groups. Then you can use --group docs|test|... depending the workflow

https://mgaitan.github.io/python-package-copier-template/design_decisions.html#dependency-management-with-uv

Comment thread CONTRIBUTING.md

```shell
uvx --with-requirements docs/requirements.txt -- mkdocs serve -f mkdocs.yml
uvx --from "mkdocs==1.6.0" --with-requirements docs/requirements.txt mkdocs serve -f mkdocs.yml

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Same here

Comment thread Dockerfile

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I cannot review this file, I know nothing about docker 😆


```bash
uvx --with-requirements script.py ty check script.py
uvx --with-requirements script.py ty@0.0.72 check script.py

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We might be able to get rid of this uvx invocation altogether and replace it with uv check either now or soon (cc @MichaReiser). But that definitely doesn't need to be done in this PR

@AlexWaygood AlexWaygood left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think any of my comments should block merging this on a second look, they can all be followups

Comment thread .github/workflows/ci.yaml

- name: "Build docs"
run: uvx --with-requirements docs/requirements.txt mkdocs build --strict -f mkdocs.yml
run: uvx --from "mkdocs==1.6.0" --with-requirements docs/requirements.txt mkdocs build --strict -f mkdocs.yml

@AlexWaygood AlexWaygood Aug 16, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looking more closely, possibly we should convert the whole docs/requirements.txt file into a docs dependency group in pyproject.toml

@AlexWaygood

Copy link
Copy Markdown
Member

Seems like the best way forward here is to rebase this and split out the Docker changes into a standalone PR?

This branch has not been deployed

No deployments
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