Skip to content

Commit

Permalink
Update common files (#497)
Browse files Browse the repository at this point in the history
  • Loading branch information
micronaut-build committed Mar 7, 2022
1 parent eeea053 commit 7466189
Show file tree
Hide file tree
Showing 14 changed files with 269 additions and 145 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/central-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: v${{ github.event.inputs.release_version }}
- uses: gradle/wrapper-validation-action@v1
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/dependency-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
dependency-updates:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions/cache@v2.1.7
with:
path: ~/.gradle/caches
Expand All @@ -32,7 +32,7 @@ jobs:
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }}
run: ./gradlew useLatestVersions
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3.12.0
uses: peter-evans/create-pull-request@v3.14.0
with:
token: ${{ secrets.GH_TOKEN }}
committer: micronaut-build <${{ secrets.MICRONAUT_BUILD_EMAIL }}>
Expand Down
19 changes: 9 additions & 10 deletions .github/workflows/graalvm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,29 +19,28 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
java: ['java11']
java: ['11', '17']
steps:
# https://github.com/actions/virtual-environments/issues/709
- name: Free disk space
run: |
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
sudo apt-get clean
df -h
- uses: actions/checkout@v2
df -h
- uses: actions/checkout@v3
- uses: actions/cache@v2.1.7
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Setup GraalVM CE
uses: DeLaGuardo/setup-graalvm@5.0
uses: graalvm/setup-graalvm@v1
with:
graalvm: 21.2.0
java: ${{ matrix.java }}
- name: Install Native Image
run: gu install native-image
version: '22.0.0.2'
java-version: ${{ matrix.java }}
components: 'native-image'
- name: Build with Gradle
run: |
if ./gradlew tasks --no-daemon --all | grep -w "testNativeImage"
Expand All @@ -57,7 +56,7 @@ jobs:
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }}
- name: Publish Test Report
if: always()
uses: mikepenz/action-junit-report@v2
uses: mikepenz/action-junit-report@v2.9.1
with:
check_name: GraalVM CE CI / Test Report (${{ matrix.java }})
check_name: GraalVM CE CI / Test Report (Java ${{ matrix.java }})
report_paths: '**/build/test-results/test/TEST-*.xml'
6 changes: 3 additions & 3 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
java: ['8', '11', '16']
java: ['8', '11', '17']
steps:
# https://github.com/actions/virtual-environments/issues/709
- name: Free disk space
Expand All @@ -28,7 +28,7 @@ jobs:
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
sudo apt-get clean
df -h
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions/cache@v2.1.7
with:
path: ~/.gradle/caches
Expand Down Expand Up @@ -59,7 +59,7 @@ jobs:
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }}
- name: Publish Test Report
if: always()
uses: mikepenz/action-junit-report@v2
uses: mikepenz/action-junit-report@v2.9.1
with:
check_name: Java CI / Test Report (${{ matrix.java }})
report_paths: '**/build/test-results/test/TEST-*.xml'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
if: github.repository != 'micronaut-projects/micronaut-project-template'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions/cache@v2.1.7
with:
path: ~/.gradle/caches
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/release-notes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ on:
- '[1-9]+.[0-9]+.x'
jobs:
release_notes:
if: github.repository != 'micronaut-projects/micronaut-project-template'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Check if it has release drafter config file
id: check_release_drafter
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
token: ${{ secrets.GH_TOKEN }}
- uses: gradle/wrapper-validation-action@v1
Expand Down Expand Up @@ -64,7 +64,7 @@ jobs:
GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USERNAME }}
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }}
- name: Checkout micronaut-core
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
token: ${{ secrets.GH_TOKEN }}
repository: micronaut-projects/micronaut-core
Expand Down
58 changes: 58 additions & 0 deletions .github/workflows/sonarqube.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# WARNING: Do not edit this file directly. Instead, go to:
#
# https://github.com/micronaut-projects/micronaut-project-template/tree/master/.github/workflows
#
# and edit them there. Note that it will be sync'ed to all the Micronaut repos
name: Static Analysis
on:
push:
branches:
- master
- '[1-9]+.[0-9]+.x'
pull_request:
branches:
- master
- '[1-9]+.[0-9]+.x'
jobs:
build:
if: github.repository != 'micronaut-projects/micronaut-project-template'
runs-on: ubuntu-latest
steps:
# https://github.com/actions/virtual-environments/issues/709
- name: Free disk space
run: |
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
sudo apt-get clean
df -h
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/cache@v2.1.7
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Set up JDK
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: 11
- name: Optional setup step
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USERNAME }}
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }}
run: |
[ -f ./setup.sh ] && ./setup.sh || true
- name: Analyse with Gradle
run: |
./gradlew check sonarqube --no-daemon --parallel --continue
env:
TESTCONTAINERS_RYUK_DISABLED: true
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USERNAME }}
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ target/
.gradle/
.idea/
build/
!build-logic/src/main/java/io/micronaut/build
classes/
out/
*.db
Expand Down
40 changes: 20 additions & 20 deletions MAINTAINING.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,35 +41,35 @@ There are sometimes where we are not sure whether we want or can solve an issue.
There are also a bunch of `relates-to` labels that can be used to further categorise issues. This is helpful in projects
with a lot of issues, or projects where different people work on different parts or modules.

The majority of the issues are defined in the
The majority of the issues are defined in the
[management](https://github.com/micronaut-projects/management/blob/master/labels.tf) repo, and propagated via Terraform.
If you want new labels:

* If they can be beneficial to several repos, send a pull request to the management repo.
* If they are repo-specific, just go ahead and create them with the GitHub UI.

Finally, issues (especially bugs) should be prioritised with either `priority: high`, `priority: medium` or
Finally, issues (especially bugs) should be prioritised with either `priority: high`, `priority: medium` or
`priority: low`. Checkout the
[Issue Priority Labels](https://github.com/micronaut-projects/micronaut-core/wiki/Issue-Priority-Labels) document for
guidelines about when to use each of them.

## Review pull requests

Pull requests, regardless of whether they are created by internal or external contributors, should meet the following
Pull requests, regardless of whether they are created by internal or external contributors, should meet the following
criteria:

* All the GitHub checks are passing (CLA signed and builds passing).
* Code has a minimum quality, it uses the Micronaut APIs correctly, doesn't contain bad smells, etc. Essentially, the
type of things you would review in every other software project.
* Contains tests.
* Includes documentation.
* If it closes any issues,
* If it closes any issues,
[they should be linked](https://docs.github.com/en/free-pro-team@latest/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue)
either using closing keywords, or manually.

Regarding the target branch, backwards-compatible bug fixes and improvements typically target the default branch,
Regarding the target branch, backwards-compatible bug fixes and improvements typically target the default branch,
backwards-compatible enhancements target the next minor version branch, and breaking changes target the next major version
branch. Check the
branch. Check the
[Micronaut Module Versioning](https://github.com/micronaut-projects/micronaut-core/wiki/Micronaut-Module-Versioning)
document for more information.

Expand All @@ -78,7 +78,7 @@ patch/minor release we don't leak breaking changes. Check the
[Micronaut Module Branch Naming](https://github.com/micronaut-projects/micronaut-core/wiki/Micronaut-Module-Branch-Naming)
document for more information.

Note that
Note that
[Micronaut Core and Starter](https://github.com/micronaut-projects/micronaut-core/wiki/Micronaut-Core-and-Starter-Branching-Strategy)
follow a slightly different strategy.

Expand All @@ -93,17 +93,17 @@ All Micronaut repos have 2 dependency upgrade checking mechanism:
those defined in `gradle.properties`. It will also send different PRs for the same version upgrade if the artifact ID
is different. For example, if you have `com.example:client:1.0` and `com.example:server:1.0`, and a new 1.1 version
arrives for both, it will send 2 PRs, where they should both be upgraded at the same time.

2. To overcome those disadvantages, we have our own dependency upgrade solution based on the
[Gradle Use Latest Versions Plugin](https://github.com/patrikerdes/gradle-use-latest-versions-plugin). It runs daily
during weekdays.

The consequence of having both approaches in place is that we get multiple dependency upgrade PRs: one created by
`micronaut-build` via our automation, and one or many (one per dependency) created by Dependabot. When merging those, it
is better to prefer the `micronaut-build` ones, if possible, for 2 reasons: a) they attempt to upgrade multiple dependencies
is better to prefer the `micronaut-build` ones, if possible, for 2 reasons: a) they attempt to upgrade multiple dependencies
in a single PR, which creates less noise in the Git history; b) Once you merge that, Dependabot will react and automatically
close its own PRs if the dependecy is up-to-date.

When an upgrade to a new version arrives, we need to be careful when merging, so that we don't introduce an
unnecessary upgrade burden on our users. Read the
[Module Upgrade Strategy](https://github.com/micronaut-projects/micronaut-core/wiki/Module-Upgrade-Strategy) for more
Expand Down Expand Up @@ -157,7 +157,7 @@ Note that it is perfectly possible to have new workflows that aren't part of the
The release process is highly automated and normally involves just publishing a GitHub release. But before you get there,
there are some parts you need to understand first.

First of all, all the repos have an automatic changelog generation mechanism: when a change is made to the repo
First of all, all the repos have an automatic changelog generation mechanism: when a change is made to the repo
(a push event), it creates (or updates if there is already one) a draft release, calculating the next patch version. The
release notes will contain pull requests merged and issues closed since the last release.

Expand All @@ -168,21 +168,21 @@ If you are publishing a milestone or release candidate, check the pre-release ch

Note that the release tags must be preceded with `v`, e.g.: `v1.2.3`.

Once you publish the GitHub release, the
Once you publish the GitHub release, the
[Release GitHub Action workflow](https://github.com/micronaut-projects/micronaut-project-template/blob/master/.github/workflows/release.yml)
will kick off, performing the following steps:

* Pre-release: sets the `projectVersion` property in `gradle.properties` to the release version, and commit and pushes
* Pre-release: sets the `projectVersion` property in `gradle.properties` to the release version, and commit and pushes
the result.
* Generates documentation guide and publishes it to the `gh-pages` branch.
* Sends a pull request to Core to update the BOM.
* Post-release:
* Post-release:
* Determines the next patch version, and sets it as a `SNAPSHOT` version.
* Closes the milestone that matches the release version, and creates a new one for the next patch.

If everything goes well, you now need to manually trigger the Maven Central publishing workflow via the GitHub UI.

If there is an issue with the release, it's important not to trigger the Maven Central publishing workflow because once
If there is an issue with the release, it's important not to trigger the Maven Central publishing workflow because once
we publish a version to Maven Central we cannot change or remove it anymore.

There are some properties in `gradle.properties` that affect the release process:
Expand All @@ -192,19 +192,19 @@ There are some properties in `gradle.properties` that affect the release process
* `bomProperty`: in Micronaut Core's `gradle.properties`, the property that represents this module's version.
* `bomProperties`: if needed, additional properties for the BOM pull request.

For example, assuming a module has the release `1.0.0` as the latest version published, which was included in the
For example, assuming a module has the release `1.0.0` as the latest version published, which was included in the
Micronaut `2.2.0` BOM. If the next version you want to publish is:

* A new patch release (`1.0.1`): simply publish the existing draft release.
* A new minor release (`1.1.0`):
* A new minor release (`1.1.0`):
* Before the release, push a `1.0.x` branch off `master`.
* Bump the version in master to `1.1.0-SNAPSHOT`.
* Set the `githubCoreBranch` property to `2.3.x` (or `3.0.x` if it will be the next one).
* Edit the draft release setting the version to `1.1.0` in the release title, body, tag, etc.
* Publish the release.
* A new major release (`2.0.0`):
* A new major release (`2.0.0`):
* Before the release, push a `1.0.x` branch off `master`.
* Bump the version in master to `2.0.0-SNAPSHOT`.
* Set the `githubCoreBranch` property to `3.0.x` (or `2.3.x` if this new major version doesn't introduce breaking changes).
* Edit the draft release setting the version to `2.0.0` in the release title, body, tag, etc.
* Publish the release.
* Publish the release.
16 changes: 16 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Security Policy

We release patches for security vulnerabilities. Which versions are eligible
receiving such patches depend on the CVSS v3.0 Rating:

| CVSS v3.0 | Supported Versions |
| --------- | ----------------------------------------- |
| 9.0-10.0 | Releases within the previous three months |
| 4.0-8.9 | Most recent release |

## Reporting a Vulnerability

Please responsibly disclose (suspected) security vulnerabilities to
**[The Micronaut Foundation](foundation@micronaut.io)**. You will receive a response from
us within 48 hours. If the issue is confirmed, we will release a patch as soon
as possible depending on complexity but historically within a few days.
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 7466189

Please sign in to comment.