Repository navigation
Studio: do not upload the seed token when publishing a dataset - #11230
Conversation
Reproduction and fix verificationTwo kinds of evidence: a CI A/B on the publish path, and a real end-to-end publish to the Hugging Face Hub. 1. A/B on GitHub ActionsSame workflow, same probe, same dependencies on both branches. The only difference is
Negative-branch log: Positive branch, same probe: 2. Real publish to the Hub
BEFORE ( "seed_config": {
"source": {
"seed_type": "hf",
"path": "datasets/acme/private-seed/data/*.parquet",
"token": "hf_FAKE_SEED_TOKEN_FOR_PR11230_EVIDENCE"
},
"sampling_strategy": "ordered"
}AFTER (this PR), same request: "seed_config": {
"source": {
"seed_type": "hf",
"path": "datasets/acme/private-seed/data/*.parquet"
},
"sampling_strategy": "ordered"
}Nothing else about the published dataset moved: both repos contained the same five paths ( |
…ecipe dataset builder_config.json is always written as BuilderConfig(data_designer=...), and the hf and github_repo seed sources store a flat token field, so remove that one key instead of every nested token under an unwrapped or wrapped config. Tests cover the two real sources, the real file shape, and a recipe without a seed.
|
Pushed 536571a on top: |
|
Codex review on a staging copy of this branch (head 536571a merged onto main), since the connector is not responding here: Didn't find any major issues — Lyxot#56 (comment) |
Lyxot
left a comment
There was a problem hiding this comment.
LGTM. Fixes a real leak: the hf and github_repo seed tokens in builder_config.json were uploaded to the Hub as-is. The token is now dropped from an uploaded copy only, the local artifact is untouched, and recipes without a seed or without a builder config publish as before. Verified end to end against the real Data Designer 0.5.4 client; Studio tests and Codex review are clean, and the remaining CI failures are unrelated flaky tests.
…thai#11230) * Studio: keep the seed block's token out of the published builder_config.json * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Tests: assert metadata still uploads when there is no builder config * refactor(studio): drop only the seed source token when publishing a recipe dataset builder_config.json is always written as BuilderConfig(data_designer=...), and the hf and github_repo seed sources store a flat token field, so remove that one key instead of every nested token under an unwrapped or wrapped config. Tests cover the two real sources, the real file shape, and a recipe without a seed. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Lyxot <[email protected]>
When a recipe uses a Hugging Face or GitHub token in its seed block, that token is saved in the run's builder_config.json. Publish to Hugging Face uploaded that file as is, so anyone who could see the dataset repo could read the token.
Publish now uploads a copy of the file with the token removed. The dataset card gets the same cleaned copy. The file on your own disk is not changed, so re-running the recipe still works.
Tested by publishing a recipe from Studio to a private Hub repo before and after, then downloading the uploaded file. Before, the token was in it. After, it is gone and the rest of the config is intact.