Skip to content

docs: trigger the docs-pages workflow on release branches#17281

Merged
denesb merged 2 commits intoscylladb:nextfrom
benipeled:gh_workflow_docs_trigger
Mar 7, 2024
Merged

docs: trigger the docs-pages workflow on release branches#17281
denesb merged 2 commits intoscylladb:nextfrom
benipeled:gh_workflow_docs_trigger

Conversation

@benipeled
Copy link
Copy Markdown
Contributor

Currently, the github docs-pages workflow is triggered only when changes are merged to the master/enterprise branches, which means that in the case of changes to a release branch, for example, a fix to branch-5.4, or a branch-5.4>branch-2024.1 merge, the docs-pages is not triggering and therefore the documentation is not updated with the new change,

In this change, I added the branch-** pattern, so changes to release branches will trigger the workflow

@tzach
Copy link
Copy Markdown
Contributor

tzach commented Feb 12, 2024

Looks good.
A future optimization can deploy only the branch pages when a branch changes. Not sure it's feasible or worth the effort.

@benipeled
Copy link
Copy Markdown
Contributor Author

@dgarcia360 ^

@dgarcia360
Copy link
Copy Markdown
Contributor

It won't work. When a branch- related branch receives a new commit, it will take the versions defined in the conf.py of that branch instead of the ones defined in the default branch. We have a couple of issues opened to trigger the publication of release branches:

@annastuchlik
Copy link
Copy Markdown
Collaborator

When abranch-related branch receives a new commit, it will take the versions defined in the conf.py of that branch instead of the ones defined in the default branch.

@benipeled To sum up, we specify which branches we want to publish in conf.py on master/enterprise, so the workflow must run on master/enterprise. If we ran it on a different branch, it would take conf.py from that branch - but that conf.py would not be up to date.

I think we need to close this PR, but we'll queue scylladb/sphinx-scylladb-theme#886 to improve the current solution.
In the meantime, it would be great if I could run the Docs workflow manually to prevent publication delays.

@benipeled
Copy link
Copy Markdown
Contributor Author

When abranch-related branch receives a new commit, it will take the versions defined in the conf.py of that branch instead of the ones defined in the default branch.

@benipeled To sum up, we specify which branches we want to publish in conf.py on master/enterprise, so the workflow must run on master/enterprise. If we ran it on a different branch, it would take conf.py from that branch - but that conf.py would not be up to date.

If we have one conf.py for all versions - the one in the default branch - we can adjust the checkout to use the default branch, something like (we need to add another environment variable similar to the FLAG):

- name: Checkout
  uses: actions/checkout@v3
  with:
    ref: ${{ env.DEFAULT_BRANCH }}
    persist-credentials: false
    fetch-depth: 0

This way the pages will always be built from the default branch even when they'll trigger from another branch

@annastuchlik
Copy link
Copy Markdown
Collaborator

Sounds good to me, but I need to defer to @dgarcia360.

@dgarcia360
Copy link
Copy Markdown
Contributor

  • name: Checkout
    uses: actions/checkout@v3
    with:
    ref: ${{ env.DEFAULT_BRANCH }}
    persist-credentials: false
    fetch-depth: 0

@benipeled looks good. I'm testing the proposed solution in scylladb/sphinx-scylladb-theme#1023

If it works, could you please update this PR?

@benipeled benipeled force-pushed the gh_workflow_docs_trigger branch from beec69f to c06282b Compare February 26, 2024 07:53
@benipeled
Copy link
Copy Markdown
Contributor Author

  • name: Checkout
    uses: actions/checkout@v3
    with:
    ref: ${{ env.DEFAULT_BRANCH }}
    persist-credentials: false
    fetch-depth: 0

@benipeled looks good. I'm testing the proposed solution in scylladb/sphinx-scylladb-theme#1023

If it works, could you please update this PR?

Done

PS> I like the ${{ github.event.repository.default_branch }} you use on the other PR. In this case, I want to explicitly specify the required branch and not rely on an external variable that might change.

Currently, the github docs-pages workflow is triggered only when changes
are merged to the master/enterprise branches, which means that in the
case of changes to a release branch, for example, a fix to branch-5.4,
or a branch-5.4>branch-2024.1 merge, the docs-pages is not triggering and
therefore the documentation is not updated with the new change,

In this change, I added the `branch-**` pattern, so changes to release
branches will trigger the workflow.
In order to publish the docs-pages from release branches (see the other
commit), we need to make sure that docs is always built from the default
branch which contains the updated conf.py

Ref scylladb#17281
@dgarcia360
Copy link
Copy Markdown
Contributor

dgarcia360 commented Mar 5, 2024

@benipeled
Copy link
Copy Markdown
Contributor Author

@scylladb/scylla-maint please merge

@annastuchlik annastuchlik added the documentation Requires documentation label Mar 5, 2024
@denesb denesb merged commit 28639e6 into scylladb:next Mar 7, 2024
@denesb
Copy link
Copy Markdown
Contributor

denesb commented Mar 7, 2024

@benipeled in the future, please use master as the target branch, not next.

@benipeled
Copy link
Copy Markdown
Contributor Author

@benipeled in the future, please use master as the target branch, not next.

Why? is it effect somehow the merge script?
I always change the target to next to avoid a case when someone will use the merge button on the PR page and merge it directly to the master

dgarcia360 pushed a commit to dgarcia360/scylla that referenced this pull request Apr 30, 2024
In order to publish the docs-pages from release branches (see the other
commit), we need to make sure that docs is always built from the default
branch which contains the updated conf.py

Ref scylladb#17281
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants