Skip to content

Conversation

@ydshieh
Copy link
Collaborator

@ydshieh ydshieh commented Dec 6, 2024

What does this PR do?

We need the token CIRCLE_TOKEN to be used in the generated CircleCI config file.

}
if "CIRCLE_TOKEN" in os.environ:
# For private forked repo. (e.g. new model addition)
config["workflows"] = {"version": 2, "run_tests": {"jobs": [{j.job_name: {"context": ["TRANSFORMERS_CONTEXT"]}} for j in jobs]}}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The token is defined within a context TRANSFORMERS_CONTEXT (set in CircleCI organization setting)

@ydshieh ydshieh requested a review from LysandreJik December 6, 2024 08:39
"workflows": {"version": 2, "run_tests": {"jobs": [j.job_name for j in jobs]}}
"jobs" : {j.job_name: j.to_dict() for j in jobs}
}
if "CIRCLE_TOKEN" in os.environ:
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

If this is available, it means we are in a repo. that is not transformers (i.e. private forked repo.)

It is determined by (in config.yml)

    setup_and_quality_2:
        when:
            not:
                 equal: [<<pipeline.project.git_url>>, https://github.com/huggingface/transformers]
        jobs:
            ...
            - fetch_tests:
                # [reference] https://circleci.com/docs/contexts/
                context:
                    - TRANSFORMERS_CONTEXT

@ydshieh
Copy link
Collaborator Author

ydshieh commented Dec 6, 2024

cc @molbap FYI

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Copy link
Member

@LysandreJik LysandreJik left a comment

Choose a reason for hiding this comment

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

Top thanks @ydshieh!

@ydshieh ydshieh merged commit 15ab310 into main Dec 6, 2024
25 checks passed
@ydshieh ydshieh deleted the fix_private_repo_ci branch December 6, 2024 11:03
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