Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix PANTS_SHA install caching. #174

Merged
merged 2 commits into from
May 9, 2023
Merged

Conversation

jsirois
Copy link
Contributor

@jsirois jsirois commented May 9, 2023

Fixes #173

@jsirois
Copy link
Contributor Author

jsirois commented May 9, 2023

I don't know of a good way to test this. Manually tested of course, but ensuring the result is cached requires poking at internals or turning off the network.

@jsirois jsirois requested a review from kaos May 9, 2023 19:26
Copy link
Member

@kaos kaos left a comment

Choose a reason for hiding this comment

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

I don't know of a good way to test this.

In what context is the PANTS_VERSION_PROMPT_SALT available?

Two subsequent runs should have the same salt when this works, right?

@jsirois
Copy link
Contributor Author

jsirois commented May 9, 2023

In what context is the PANTS_VERSION_PROMPT_SALT available?

Only when no Pants version is supplied (via pants.toml, PANTS_VERSION or PANTS_SHA)

Two subsequent runs should have the same salt when this works, right?

They should have no PANTS_VERSION_PROMPT_SALT env var set at all, that was the bug. That's a very direct test of internals that doesn't do much though. I'm hoping for an IT, something that actually tests a back slide robust to details.

Copy link
Sponsor Member

@stuhood stuhood left a comment

Choose a reason for hiding this comment

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

Thanks!


Re: testing: yea, had the same realization for #172. I'm not sure what to do about that... maybe a Pants plugin which reports some details of the invoke? But it would be a big abstraction leak for any of that information to actually be exposed to plugins, so...

@jsirois jsirois merged commit efb726f into pantsbuild:main May 9, 2023
@jsirois jsirois deleted the issues/173 branch May 9, 2023 20:52
@kaos
Copy link
Member

kaos commented May 9, 2023

In what context is the PANTS_VERSION_PROMPT_SALT available?

Only when no Pants version is supplied (via pants.toml, PANTS_VERSION or PANTS_SHA)

Two subsequent runs should have the same salt when this works, right?

They should have no PANTS_VERSION_PROMPT_SALT env var set at all, that was the bug. That's a very direct test of internals that doesn't do much though. I'm hoping for an IT, something that actually tests a back slide robust to details.

Oh right. Yea, in my mind it merely changed the value.

Guess an IT would have to capture network traffic or something like that maybe in order to detect the side-effect of using PANTS_SHA or not. Feels like a lot of work for a relatively small feature.

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.

Use of PANTS_SHA reexecutes some bootstrapping logic on each run
3 participants