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

Limit maintenance in the push-content.yml workflow of documentation content repositories #472

Open
tbouffard opened this issue Nov 8, 2022 · 1 comment

Comments

@tbouffard
Copy link
Member

tbouffard commented Nov 8, 2022

Current problem

This applies to repositories related to documentation components with several versions (bcd, bonita, test-toolkit) i.e not with a single branch (cloud, labs).

Today, we hard code the version in the event we sent. When initializing the content for a new version, the version must be updated in the event and sometimes it is not by mistake. This means that the event are sent with wrong information and the Netlify logs are not accurate. As we almost never check the workflow and the logs, it can take weeks before we detect the problem, and often, we discover it when we review the Netlify logs to troubleshoot an issue. This is too late and this can leads to wrong conclusions.

The push-content event is sent when a new push is done in the branch
The allowed branch for the push event triggering the workflow is hard coded in the workflow. It must match the actual branch where the workflow is stored. If the branch value in the workflow doesn't match the actual branch, the workflow doesn't run and the event is not sent.

Proposal

My proposal is that instead of hard coded the version in the event, we could deduced it from the branch that stores the definition of the workflow. This will work with both push and workflow_dispatch events. The information is available in the github context.
On new component version initialization, the event will be correct, but the allowed branch of the push event may be inaccurate. The event won't be sent until it is updated. At a given time, someone will notice that when they merge their PR in this branch, the change is not pushed to production.

We could store the whole logic in a shared action or in a reusable workflow as we plan to do for other workflows in #422. It will help updating all repositories and implement new features in the future like #228 and #275.
This may also help for #765.

To automatically retrieve the name of the branch in the documentation content repository, see #472 (comment)

Current workflow configurations

Bonita 2021.1

https://github.com/bonitasoft/bonita-doc/blob/9f6cb8779e3e270bbd5aa1849c773033447772f2/.github/workflows/push-content.yml#L3-L22

Bonita 2023.1

https://github.com/bonitasoft/bonita-doc/blob/8d06f2cab16e8efa67a47e3869122fde633ba73d/.github/workflows/push-content.yml#L3-L22

@tbouffard
Copy link
Member Author

tbouffard commented Apr 2, 2024

In the bcd repo, the branch parameter in the sent event is no longer hard coded in the event:

In addition, to make the content propagation easier to do (merge), the workflow in the oldest supported version list all branches that are allow to trigger the dispatch_event.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant