skops
skops copied to clipboard
Remove token from hub_utils.tests.common.py and move to secrets
We should remove the token from the repo and move it to secrets, but we should make sure it works on PRs from forks.
@BenjaminBossan would you be up for this one?
I would be up but I have no idea yet how to actually solve the problem.
It's possible to have this work in PRs by doing some magic in GH actions, but then running the tests for users would require them to give a token. On the other hand, it's already the case that users would need to pass their token to create the docs. So maybe that's not a big issue?
On the other hand, it's already the case that users would need to pass their token to create the docs
They could still use the checked in token for that.
running the tests for users would require them to give a token
I don't really see a good solution for that. We could mark all tests that require a valid token (which amounts to the network tests I guess) and if users don't provide a token, skip them. If they make changes that don't require those tests, then we're fine, else they have to provide their own token . At the end of the day, all tests will be run on CI.
yeah I guess that works.
Just noticed we also haven the token here. This one could really be replaced by a GH secret, though I guess we would also need to invalidate it since it's already public, and as long as we still use the same token for tests, nothing is gained.
@BenjaminBossan AFAIK once you remove it on 🤗Hub it's invalidated. I think I don't have the user access to add tokens (I don't see the settings tab) maybe @adrinjalali can do it (and then we can replace the token with the secret).
yeah that one is the same as the one used by tests to create the repos. So changing it doesn't gain us anything.