-
-
Notifications
You must be signed in to change notification settings - Fork 25.6k
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
MAINT only trigger towncrier when targeting main branch #30251
Conversation
ping @adrinjalali @jeremiedbb |
build_tools/circle/build_doc.sh
Outdated
@@ -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$ ) ]] |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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 :)
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
scikit-learn/build_tools/circle/build_doc.sh
Lines 24 to 27 in 9012b78
# 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.
There was a problem hiding this comment.
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.
There was a problem hiding this 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.
There was a problem hiding this 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.
Co-authored-by: Loïc Estève <[email protected]>
Co-authored-by: Loïc Estève <[email protected]>
…#30251) Co-authored-by: Loïc Estève <[email protected]>
Co-authored-by: Loïc Estève <[email protected]>
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 inmain
to build the changelog in dev.