You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: .github/workflows.md
+8-22
Original file line number
Diff line number
Diff line change
@@ -16,35 +16,21 @@ We have two types of files in the `/workflows` directory:
16
16
- they shouldn't (and can't) be used in isolation, as they don't take care of the code being checked out
17
17
- 📄 starting with `workflow_` indicate a collection of jobs that are automatically triggered by certain events or actions
18
18
19
-
## Pipelines
19
+
## Pipelines and workflows
20
20
21
-
We have two types of workflows triggered by Pull Requests:
21
+
We have one workflow triggered by Pull Requests. When a Pull Request is opened, we run selected jobs based on the location and changes made in the code. We have two sets of jobs:
22
22
23
-
1. When a Pull Request is opened, we run selected jobs based on the location and changes made in the code. We have two sets of jobs:
24
-
- if changes are made inside the `/coral` directory, we run all [coral jobs](./workflows/jobs-coral.yaml)
25
-
- if are made outside in `/core` or `/cluster-api` directories or `pom.xml`, we run all [maven jobs](./workflows/jobs-maven.yaml). This jobs are only run when the Pull Request is ready for review, excluding "Draft" PRs.
26
-
2. When a Pull Request is approved, the [`workflow-merge-to-main`](./workflows/workflow-merge-to-main.yaml) is triggered.
23
+
- if changes are made inside the `/coral` directory, we run all [coral jobs](./workflows/jobs-coral.yaml)
24
+
- if are made outside in `/core` or `/cluster-api` directories or `pom.xml`, we run all [maven jobs](./workflows/jobs-maven.yaml).
27
25
28
-
- This workflow runs all [coral jobs](./workflows/jobs-coral.yaml) and [maven jobs](./workflows/jobs-maven.yaml)
29
-
- After they are successful, it runs a job called `merge-to-main`. This job is defined in the [Branch protection rule](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/managing-a-branch-protection-rule) for `main` and is and is necessary to enable merging on our default branch.
26
+
These jobs are only run when the Pull Request is ready for review, excluding "Draft" PRs.
30
27
31
-
**Note**: This workflow is also triggered when a Pull Request targeting main is synchronized. This way we make sure that the checks are always automatically run on the latest code.
28
+
We have one workflow [`workflow-merge-to-main`](./workflows/workflow-merge-to-main.yaml) that we run in a merge queue before merging an approved PR branch to `main`.
32
29
33
-
In addition, we have a workflow that is triggered when changes are made to the `openapi.yaml file`. We check whether the changes affect the TypeScript file in `/coral`. If the changes do affect the TypeScript file, the `api.d.ts` file is automatically generated, and the TypeScript compiler is run. If the TypeScript compiler finds no errors, the file is committed. Otherwise the job fails.
34
-
35
-
## Drawbacks
36
-
37
-
We have identified two potential drawbacks with this strategy:
30
+
- This workflow runs all [coral jobs](./workflows/jobs-coral.yaml) and [maven jobs](./workflows/jobs-maven.yaml)
38
31
39
-
1. There will be a delay between approving a Pull Request and merging it because of the required job on approval. We can mitigate this in the future:
40
-
41
-
- by adding automatic notification about a PR being ready to merge.
42
-
- consider auto-merging it in the future. Currently, we prefer manual merges to maintain more control over the process.
43
-
44
-
2. Depending on the workflow, some job runs may be redundant and increase the time between giving a Pull Request for review and merging it.
32
+
In addition, we have a workflow that is triggered when changes are made to the `openapi.yaml file`. We check whether the changes affect the TypeScript file in `/coral`. If the changes do affect the TypeScript file, the `api.d.ts` file is automatically generated, and the TypeScript compiler is run. If the TypeScript compiler finds no errors, the file is committed. Otherwise the job fails.
45
33
46
-
- We plan to iterate over our workflows to reduce redundancy and improve efficiency and will pay attention if this slows us down,
47
-
- We are using the `merge-to-main` workflow as a temporary solution until we move to GitHub merge queues, when they become mores stable.
0 commit comments