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

MAINT only trigger towncrier when targeting main branch #30251

Merged

Conversation

glemaitre
Copy link
Member

When working on release branch, we should not automatically generate towncrier because this job is done by hand.

We witnessed that the current rule is wrong:
#30244

This PR check that we target main and we are in a PR to build the documentation or that we are in main to build the changelog in dev.

Copy link

github-actions bot commented Nov 8, 2024

✔️ Linting Passed

All linting checks passed. Your pull request is in excellent shape! ☀️

Generated for commit: e9f908f. Link to the linter CI: here

@glemaitre
Copy link
Member Author

ping @adrinjalali @jeremiedbb

@@ -183,7 +184,7 @@ ccache -s

export OMP_NUM_THREADS=1

if [[ "$CIRCLE_BRANCH" =~ ^main$ || -n "$CI_PULL_REQUEST" ]]
if [[ "$CIRCLE_BRANCH" =~ ^main$ || ( -n "$CI_PULL_REQUEST" && "$CIRCLE_TARGET_BRANCH" =~ ^main$ ) ]]
Copy link
Member

Choose a reason for hiding this comment

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

you named it CI_TARGET_BRANCH above. Why is it not CIRCLE_BRANCH ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Because we are running in GitHub Action nowadays :)

Copy link
Member Author

Choose a reason for hiding this comment

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

The script is translating the variables

Copy link
Member

Choose a reason for hiding this comment

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

can you point me where ? I can't find it

Copy link
Member Author

Choose a reason for hiding this comment

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

Uhm Actually I'm wrong. It seems that our code work on both CircleCI and GitHub Actions but we are still using CircleCI.

# Map the variables from Github Action to CircleCI
CIRCLE_SHA1=$(git log -1 --pretty=format:%H)
CIRCLE_JOB=$GITHUB_JOB

So it means that my fix is not working. I should instead find the corresponding CircleCI environment variable.

Copy link
Member

Choose a reason for hiding this comment

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

Honestly we should remove the Github translation code. There may be a little bit of hope that one day Github allows to have PR previews for example actions/deploy-pages#337 and https://github.com/orgs/community/discussions/7730#discussioncomment-1885967 but in the foreseeable future I think that the doc build is going to stay on CircleCI ...

Context was that at one point we had quite a complicated setup to build on Github actions, upload an artifact, download the artifact on CircleCI and have the rendered doc on CircleCI, see #25466.

Copy link
Member

@adrinjalali adrinjalali left a comment

Choose a reason for hiding this comment

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

can't tell I'm 100% sure this is right, but it looks right, and need to check after merge.

Copy link
Member

@jeremiedbb jeremiedbb left a comment

Choose a reason for hiding this comment

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

Alright, let's try that. Ping @lesteve who might want to have a look before we merge because I'm not very familiar with this script.

@lesteve lesteve enabled auto-merge (squash) November 15, 2024 13:02
@lesteve lesteve merged commit eaf9529 into scikit-learn:main Nov 15, 2024
28 checks passed
jeremiedbb pushed a commit to jeremiedbb/scikit-learn that referenced this pull request Dec 4, 2024
jeremiedbb pushed a commit that referenced this pull request Dec 6, 2024
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