Skip to content

Commit 5f73035

Browse files
authored
build: change the release and staging branching model (#1042)
This pull request refactors the current branching model to improve development and address several challenges associated with using staging as the default base branch for pull requests. With this update, main will serve as the base branch for pull requests, containing active development changes, while releases will be triggered upon merging pull requests into the newly created release branch. Signed-off-by: behnazh-w <[email protected]>
1 parent 9f11dbd commit 5f73035

File tree

9 files changed

+29
-30
lines changed

9 files changed

+29
-30
lines changed

.github/dependabot.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2022 - 2023, Oracle and/or its affiliates. All rights reserved.
1+
# Copyright (c) 2022 - 2025, Oracle and/or its affiliates. All rights reserved.
22
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/.
33

44
# This configuration file enables Dependabot version updates.
@@ -16,7 +16,7 @@ updates:
1616
prefix-development: chore
1717
include: scope
1818
open-pull-requests-limit: 13
19-
target-branch: staging
19+
target-branch: main
2020
# Add additional reviewers for PRs opened by Dependabot. For more information, see:
2121
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#reviewers
2222
# reviewers:
@@ -31,7 +31,7 @@ updates:
3131
prefix-development: chore
3232
include: scope
3333
open-pull-requests-limit: 13
34-
target-branch: staging
34+
target-branch: main
3535
# Add additional reviewers for PRs opened by Dependabot. For more information, see:
3636
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#reviewers
3737
# reviewers:
@@ -46,7 +46,7 @@ updates:
4646
prefix-development: chore
4747
include: scope
4848
open-pull-requests-limit: 13
49-
target-branch: staging
49+
target-branch: main
5050
# Add additional reviewers for PRs opened by Dependabot. For more information, see:
5151
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#reviewers
5252
# reviewers:

.github/pull_request_template.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
- [ ] My PR title and commits follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) convention.
88
- [ ] My commits include the "Signed-off-by" line.
99
- [ ] I have signed my commits following the instructions provided by [GitHub](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits). Note that we run [GitHub's commit verification](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification) tool to check the commit signatures. A green `verified` label should appear next to **all** of your commits on GitHub.
10-
- [ ] I have selected `staging` as the base branch for my PR.
1110
- [ ] I have updated the relevant documentation, if applicable.
1211
- [ ] I have tested my changes and verified they work as expected.
1312
- [ ] I have referenced the issue(s) this pull request solves.

.github/workflows/_generate-rebase.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# Copyright (c) 2023 - 2023, Oracle and/or its affiliates. All rights reserved.
1+
# Copyright (c) 2023 - 2025, Oracle and/or its affiliates. All rights reserved.
22
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/.
33

4-
# Automatically rebase one staging branch on top of main after a new package version was published.
4+
# Automatically rebase main branch on top of release after a new package version is published.
55

66
name: Rebase branch
77
on:

.github/workflows/codeql-analysis.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2022 - 2023, Oracle and/or its affiliates. All rights reserved.
1+
# Copyright (c) 2022 - 2025, Oracle and/or its affiliates. All rights reserved.
22
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/.
33

44
# Run CodeQL over the package. For more configuration options see codeql/codeql-config.yaml
@@ -9,11 +9,11 @@ on:
99
push:
1010
branches:
1111
- main
12-
- staging
12+
- release
1313
pull_request:
1414
branches:
1515
- main
16-
- staging
16+
- release
1717
schedule:
1818
- cron: 20 15 * * 3
1919
permissions:

.github/workflows/release.yaml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2022 - 2023, Oracle and/or its affiliates. All rights reserved.
1+
# Copyright (c) 2022 - 2025, Oracle and/or its affiliates. All rights reserved.
22
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/.
33

44
# We run checks on pushing to the specified branches.
@@ -9,7 +9,7 @@ on:
99
push:
1010
branches:
1111
- main
12-
- staging
12+
- release
1313
permissions:
1414
contents: read
1515
env:
@@ -28,11 +28,11 @@ jobs:
2828
contents: read
2929
packages: read
3030

31-
# On pushes to the 'main' branch create a new release by bumping the version
31+
# On pushes to the 'release' branch create a new release by bumping the version
3232
# and generating a change log. That's the new bump commit and associated tag.
3333
bump:
3434
needs: check
35-
if: github.ref == 'refs/heads/main'
35+
if: github.ref == 'refs/heads/release'
3636
runs-on: ubuntu-latest
3737
permissions:
3838
contents: write
@@ -72,26 +72,26 @@ jobs:
7272
git push
7373
git push --tags
7474
75-
# After the bump commit was pushed to the main branch, rebase the staging branch
76-
# (to_head argument) on top of the new main branch (from_base argument), to keep
75+
# After the bump commit was pushed to the release branch, rebase the main branch
76+
# (to_head argument) on top of the release branch (from_base argument), to keep
7777
# the histories of both branches in sync.
78-
rebase_staging:
78+
rebase_main:
7979
needs: [bump]
80-
name: Rebase staging branch on main
80+
name: Rebase main branch on release
8181
uses: ./.github/workflows/_generate-rebase.yaml
8282
permissions:
8383
contents: read
8484
with:
85-
to_head: staging
86-
from_base: origin/main
85+
to_head: main
86+
from_base: origin/release
8787
git_user_name: behnazh-w
8888
git_user_email: [email protected]
8989
secrets:
9090
REPO_ACCESS_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
9191

9292
# When triggered by the version bump commit, build the package and publish the release artifacts.
9393
build:
94-
if: github.ref == 'refs/heads/main' && startsWith(github.event.commits[0].message, 'bump:')
94+
if: github.ref == 'refs/heads/release' && startsWith(github.event.commits[0].message, 'bump:')
9595
uses: ./.github/workflows/_build.yaml
9696
permissions:
9797
contents: read

CONTRIBUTING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ See our [Macaron Style Guide](./docs/source/pages/developers_guide/style_guide.r
3535

3636
1. Ensure there is an issue created to track and discuss the fix or enhancement
3737
you intend to submit.
38-
2. Fork this repository including the `staging` branch. In Macaron, the `staging` branch is the active development branch and contains the most recent changes.
39-
3. Create a branch in your fork to implement the changes. Make sure to create your branch from the `staging` branch and not `main`. We recommend using the issue number as part of your branch name, e.g. `1234-fixes`.
38+
2. Fork this repository.
39+
3. Create a branch in your fork to implement the changes. We recommend using the issue number as part of your branch name, e.g. `1234-fixes`.
4040
4. The title of the PR should follow the convention of [commit messages](#commit-messages).
4141
5. Ensure that any documentation is updated with the changes that are required by your change.
4242
6. Ensure that any samples are updated if the base image has been changed.
4343
7. Submit the pull request. *Do not leave the pull request blank*. Explain exactly what your changes are meant to do and provide simple steps on how to validate. your changes. Ensure that you reference the issue you created as well.
44-
8. Choose `staging` as the base branch for your PR.
44+
8. Choose `main` as the base branch for your PR.
4545
9. We will assign the pull request to 2-3 people for review before it is merged.
4646

4747
### Commit messages
@@ -74,7 +74,7 @@ a detailed commit message body is preferred. Make sure to keep the `Signed-off-b
7474

7575
## Branching model
7676

77-
* The `main` branch is only used for releases and the `staging` branch is used for development. We only merge to `main` when we want to create a new release for Macaron.
77+
* The `main` branch should be used as the base branch for pull requests. The `release` branch is designated for releases and should only be merged into when creating a new release for Macaron.
7878

7979
## Setting up the development environment
8080

docs/source/pages/installation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Macaron is currently distributed as a Docker image. We provide a bash script ``r
2727

2828
.. note:: When run, Macaron will create output files inside the current directory where ``run_macaron.sh`` is run. If you run Docker Desktop, please make sure that the current directory is bind mountable for Docker (see the `File Sharing settings <https://docs.docker.com/desktop/settings/mac/?uuid=95C3E343-F11C-4A35-A10C-6B5431B73E14#file-sharing>`_).
2929

30-
Download the ``run_macaron.sh`` script and make it executable by running the commands (replace ``tag`` with the version you want or ``main`` for the latest version):
30+
Download the ``run_macaron.sh`` script and make it executable by running the commands (replace ``tag`` with the version you want or ``release`` for the latest version):
3131

3232
.. code-block:: shell
3333

docs/source/pages/tutorials/detect_malicious_java_dep.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ And the following relation is declared in this policy:
202202
* ``violating_dependencies(parent: number)``
203203

204204
Feel free to browse through the available
205-
relations `here <https://github.com/oracle/macaron/blob/main/src/macaron/policy_engine/prelude/>`_
205+
relations `here <https://github.com/oracle/macaron/blob/release/src/macaron/policy_engine/prelude/>`_
206206
to see how they are constructed before moving on.
207207

208208
.. code-block:: prolog

docs/source/pages/tutorials/use_verification_summary_attestation.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ Here is a pretty-printed version of the policy as it appears in the VSA, along w
121121

122122
* Applying the Policy (``apply_policy_to``): To apply the ``gcn_provenance_policy``, Macaron first determines if the ``component_id`` is a valid component and if its ``PURL`` conforms to the pattern defined in the ``match`` predicate. If both conditions are met, the policy is applied.
123123

124-
* The template Datalog policy file can be downloaded from `here <https://github.com/oracle/macaron/tree/main/src/macaron/resources/policies/gdk/policy.dl.template>`_
124+
* The template Datalog policy file can be downloaded from `here <https://github.com/oracle/macaron/tree/release/src/macaron/resources/policies/gdk/policy.dl.template>`_
125125

126126
Below you can find the template CUE file that has been used by the :ref:`mcn_provenance_expectation_1 <checks>` check at verification time to verify the provenance. It contains place holders for expected values that are populated by the GDK maintainers.
127127

@@ -148,7 +148,7 @@ Here is a pretty-printed version of the policy as it appears in the VSA, along w
148148

149149
* ``projecturl: "https://<REPO_URL>"``: This checks that the ``projecturl`` attribute exactly matches the expected Repository URL. ``<REPO_URL>`` is a placeholder for the actual repository URL, e.g., ``internal.repo.com/micronaut-projects/micronaut-core``.
150150

151-
* The template CUE expectation can be downloaded from `this location <https://github.com/oracle/macaron/tree/main/src/macaron/resources/policies/gdk/expectation.cue.template>`_.
151+
* The template CUE expectation can be downloaded from `this location <https://github.com/oracle/macaron/tree/release/src/macaron/resources/policies/gdk/expectation.cue.template>`_.
152152

153153

154154
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
@@ -175,7 +175,7 @@ Download the check_vsa.sh script
175175

176176
.. code-block:: shell
177177
178-
curl -O https://raw.githubusercontent.com/oracle/macaron/main/scripts/release_scripts/check_vsa.sh
178+
curl -O https://raw.githubusercontent.com/oracle/macaron/release/scripts/release_scripts/check_vsa.sh
179179
180180
++++++++++++++++++++++++++
181181
Make the script executable

0 commit comments

Comments
 (0)