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

Blindpirate merge release into master #27

Open
wants to merge 48 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
2e58545
check release note
blindpirate Jul 30, 2023
d113ea2
Merge remote-tracking branch 'origin/master' into blindpirate/check-r…
blindpirate Aug 7, 2023
6fcbac5
Add CheckBadMerge
blindpirate Aug 7, 2023
252889a
add missing distribution
blindpirate Aug 7, 2023
abe8c94
fetch
blindpirate Aug 7, 2023
e1499f2
Fix workflow
blindpirate Aug 7, 2023
2c09338
Remove git fetch
blindpirate Aug 7, 2023
a4abfa4
Add missing return
blindpirate Aug 7, 2023
1bee4f9
add with
blindpirate Aug 7, 2023
9e9a8c5
test
blindpirate Aug 7, 2023
a93f583
test
blindpirate Aug 7, 2023
f74d570
change on master
blindpirate Aug 7, 2023
0722803
change on release
blindpirate Aug 7, 2023
34bac77
Merge branch 'master' into release
blindpirate Aug 7, 2023
67913fc
fix params
blindpirate Aug 7, 2023
fa8d0fe
cherrypick to release
blindpirate Aug 7, 2023
f5b7f9d
fix
blindpirate Aug 7, 2023
569abba
fix
blindpirate Aug 7, 2023
0ce5a4b
depth=0
blindpirate Aug 7, 2023
3c398fe
depth=0
blindpirate Aug 7, 2023
932348e
fix
blindpirate Aug 7, 2023
e6d24a6
fix
blindpirate Aug 7, 2023
65992a2
fix
blindpirate Aug 7, 2023
634c8df
fix
blindpirate Aug 7, 2023
4fb353e
fix
blindpirate Aug 7, 2023
c657ca3
fix
blindpirate Aug 7, 2023
cf51cb3
fix
blindpirate Aug 7, 2023
cca6894
fix
blindpirate Aug 7, 2023
e818ed2
fix
blindpirate Aug 7, 2023
706fc58
fix
blindpirate Aug 7, 2023
03e735a
Merge pull request #25 from blindpirate/release
blindpirate Aug 7, 2023
0da0798
change on release
blindpirate Aug 7, 2023
d764d83
change on master
blindpirate Aug 7, 2023
9bd456d
Fix
blindpirate Aug 7, 2023
d98afc5
Fix
blindpirate Aug 7, 2023
89d963f
fix
blindpirate Aug 7, 2023
91844cf
fix
blindpirate Aug 7, 2023
4b96f7c
fix work flow
blindpirate Aug 7, 2023
a7e6bac
fix work flow
blindpirate Aug 7, 2023
1b52ec2
fix
blindpirate Aug 7, 2023
808ac07
fix
blindpirate Aug 7, 2023
a32013f
fix
blindpirate Aug 7, 2023
f4c835c
fix
blindpirate Aug 7, 2023
c424167
always
blindpirate Aug 7, 2023
3e407ee
always
blindpirate Aug 7, 2023
6064c2f
fuck
blindpirate Aug 7, 2023
6e99421
fuck
blindpirate Aug 7, 2023
7e577c8
Merge branch 'blindpirate-release' into blindpirate-merge-release-int…
blindpirate Aug 7, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
116 changes: 116 additions & 0 deletions .github/workflows/CheckBadMerge.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
import java.util.concurrent.Callable
import java.util.concurrent.Executors
import java.util.concurrent.Future

/**
* See https://github.com/gradle/gradle-private/issues/3919
*
* When merging `releaseX` branch into `master`, we should only use the release note from the `master` branch,
* but sometimes changes on release notes.md was brought to master and merged unnoticed,
* e.g https://github.com/gradle/gradle/pull/25825
*
* This script is to check if there is any merge commit that brings changes from release branch to master.
* Usage: groovy CheckBadMerge.groovy <commit1> <commit2> ...
* If any "bad" merge commit is found, it will print the details and exit with non-zero code.
*/
class CheckBadMerge {
private static final THREAD_POOL = Executors.newCachedThreadPool()

private static final List<String> MONITORED_FILES = [
"subprojects/docs/src/docs/release/notes.md"
]

static void main(String[] commits) {
println("Commits to check: ${Arrays.toString(commits)}")
try {
commits.each { checkCommit(it) }
} finally {
THREAD_POOL.shutdown()
}
}

static void checkCommit(String commit) {
List<String> parentCommits = parentCommitsOf(commit)
if (parentCommits.size() != 2) {
println("$commit is not a merge commit we're looking for. Parents: $parentCommits")
return
}

// The correct state we are looking for is:
// 1. It's a merge commit.
// 2. One of its parent commits is from master only.
// 3. Another parent commit is from master and release branch.
// Otherwise, skip this commit.
List<String> p1Branches = branchesOf(parentCommits[0])
List<String> p2Branches = branchesOf(parentCommits[1])

if (p1Branches.contains("origin/master") && !p2Branches.contains("origin/master") && p2Branches.any { it.startsWith("origin/release") }) {
List<String> badFiles = MONITORED_FILES.grep { isBadFileInMergeCommit(it, commit, parentCommits[0], parentCommits[1]) }
if (!badFiles.isEmpty()) {
throw new RuntimeException("Found bad files in merge commit $commit: $badFiles")
} else {
println("No bad files found in $commit")
}
} else {
println("$commit is not a merge commit we're looking for. Parents: $parentCommits, p1Branches: $p1Branches, p2Branches: $p2Branches")
}
}

/**
* Check if the given file is "bad": we should only use the release note from the master branch.
* This means that every line in the merge commit version should be either:
* - Only exists on `master`.
* - Exists on `master` and `releaseX`.
* If any line is only present on `releaseX` version, then it's a bad file.
* Also, we ignore empty lines.
*/
static boolean isBadFileInMergeCommit(String filePath, String mergeCommit, String masterCommit, String releaseCommit) {
List<String> mergeCommitFileLines = showFileOnCommit(mergeCommit, filePath).readLines()
List<String> masterCommitFileLines = showFileOnCommit(masterCommit, filePath).readLines()
List<String> releaseCommitFileLines = showFileOnCommit(releaseCommit, filePath).readLines()
for (String line in mergeCommitFileLines) {
if (line.trim().isEmpty()) {
continue
}
if (!masterCommitFileLines.contains(line) && releaseCommitFileLines.contains(line)) {
println("Found bad file $filePath in merge commit $mergeCommit: '$line' only exists in $releaseCommit but not in $masterCommit")
return true
}
}
return false
}

static String showFileOnCommit(String commit, String filePath) {
return getStdout("git show $commit:$filePath")
}

static List<String> branchesOf(String commit) {
return getStdout("git branch -r --contains $commit")
.readLines()
.collect { it.replace("*", "") } // remove the * from the current branch, e.g. * master -> master
.collect { it.trim() }
.grep { !it.isEmpty() }
}

static List<String> parentCommitsOf(String commit) {
return getStdout("git show --format=%P --no-patch $commit")
.split(" ").collect { it.trim() }.grep { !it.isEmpty() }
}

static String getStdout(String command) {
Process process = command.execute()
def stdoutFuture = readStreamAsync(process.inputStream)
def stderrFuture = readStreamAsync(process.errorStream)

int returnCode = process.waitFor()
String stdout = stdoutFuture.get()
String stderr = stderrFuture.get()

assert returnCode == 0: "$command failed with return code: $returnCode, stdout: $stdout stderr: $stderr"
return stdout
}

static Future<String> readStreamAsync(InputStream inputStream) {
return THREAD_POOL.submit({ inputStream.text } as Callable) as Future<String>
}
}
58 changes: 58 additions & 0 deletions .github/workflows/check-bad-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# See .github/workflows/CheckBadMerge.groovy for explanation
name: Check bad merge commit
on:
pull_request:
types:
- opened
- synchronize

jobs:
check_pr_commits:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '11'
- name: Install Groovy
run: sudo apt-get install groovy
- name: List PR commits
run: |
git log --pretty=format:"%H" ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} > pr_commits.txt
- name: Check PR commits
id: run_check
run: |
groovy .github/workflows/CheckBadMerge.groovy $(<pr_commits.txt) > output.txt 2>&1
- name: Read output file
id: read_output
if: ${{ always() }}
run: |
cat output.txt
OUTPUT=$(cat output.txt)
echo "OUTPUT<<EOF" >> $GITHUB_ENV
echo "$OUTPUT" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Comment on PR if check failed
if: ${{ failure() }}
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const output = `
Some bad merge is found:
\`\`\`
${{ env.OUTPUT }}
\`\`\`
`;
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: output
})
118 changes: 118 additions & 0 deletions merge-commit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
The Gradle team is excited to announce Gradle @version@.

This release features the support for [persistent Java compiler daemons](#faster-java-compilation) to speed up Java compilation.
Gradle will also use [less memory for dependency resolution](#reduced-memory-consumption).
The effect is significant, particularly for large builds such as Android builds.

Gradle now supports running on Java 20.

For Kotlin DSL, build authors can [try out the Kotlin K2 compiler](#kotlin_k2) for build logic with some limitations.
See the [Kotlin DSL](#kotlin-dsl-improvements) dedicated section for more information.

This release also brings several usability improvements, including better [CodeNarc output](#improved-codenarc-output), a [dry run mode](#dry-run-mode-for-test-execution) for test execution,
improved [output for task options](#group-opposite-boolean-build-and-task-options-together), and upgraded [SSL support](#ssl).

<!--
Include only their name, impactful features should be called out separately below.
[Some person](https://github.com/some-person)

THiS LIST SHOULD BE ALPHABETIZED BY [PERSON NAME] - the docs:updateContributorsInReleaseNotes task will enforce this ordering, which is case-insensitive.
-->
We would like to thank the following community members for their contributions to this release of Gradle:
[Adam](https://github.com/aSemy),
[Ahmed Ehab](https://github.com/ahmedehabb),
[Aurimas](https://github.com/liutikas),
[Baptiste Decroix](https://github.com/bdecroix-spiria),
[Björn Kautler](https://github.com/Vampire),
[Borewit](https://github.com/Borewit),
[Korov](https://github.com/Korov),
[Mohammed Thavaf](https://github.com/mthavaf),
[Patrick Brückner](https://github.com/madmuffin1),
[Philip Wedemann](https://github.com/hfhbd),
[Róbert Papp](https://github.com/TWiStErRob),
[Shi Chen](https://github.com/CsCherrYY),
[Tony Robalik](https://github.com/autonomousapps)

## Upgrade instructions

Switch your build to use Gradle @version@ by updating your wrapper:

`./gradlew wrapper --gradle-version=@version@`

See the [Gradle 8.x upgrade guide](userguide/upgrading_version_8.html#changes_@baseVersion@) to learn about deprecations, breaking changes and other considerations when upgrading to Gradle @version@.

For Java, Groovy, Kotlin and Android compatibility, see the [full compatibility notes](userguide/compatibility.html).

## New features and usability improvements

<!-- Do not add breaking changes or deprecations here! Add them to the upgrade guide instead. -->

<!--

================== TEMPLATE ==============================

<a name="FILL-IN-KEY-AREA"></a>
### FILL-IN-KEY-AREA improvements

<<<FILL IN CONTEXT FOR KEY AREA>>>
Example:
> The [configuration cache](userguide/configuration_cache.html) improves build performance by caching the result of
> the configuration phase. Using the configuration cache, Gradle can skip the configuration phase entirely when
> nothing that affects the build configuration has changed.

#### FILL-IN-FEATURE
> HIGHLIGHT the usecase or existing problem the feature solves
> EXPLAIN how the new release addresses that problem or use case
> PROVIDE a screenshot or snippet illustrating the new feature, if applicable
> LINK to the full documentation for more details

================== END TEMPLATE ==========================


==========================================================
ADD RELEASE FEATURES BELOW
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv -->


### Maven toolchain declarations with environment variables are now supported

Using [toolchains](userguide/toolchains.html) is the recommended way of specifying Java versions for JVM projects.
By default, Gradle automatically detects local JRE/JDK installations so no further configuration is required by the user.
One of the auto-detection formats that Gradle supports is Maven Toolchain specification.

With this Gradle release, if you rely on the integration with Maven toolchain definitions, Gradle now supports the use of environment variables placeholders inside `toolchain.xml` files.
The placeholder will be resolved by looking at environment variables known to the Gradle build.

<a name="ssl"></a>
### SSL improvements for non-standard keystores and truststores

Previously, Gradle exhibited limitations when interfacing with non-standard keystores and truststores.
This affected users on Linux systems with FIPS enabled and also Windows users who were storing certificates in the Trusted Root Certification Authorities store.

SSL context creation has been improved to be more aligned with the default implementation and to support these cases.


## Fixed issues

<!--
This section will be populated automatically
-->

## Known issues

Known issues are problems that were discovered post release that are directly related to changes made in this release.

<!--
This section will be populated automatically
-->

## External contributions

We love getting contributions from the Gradle community. For information on contributing, please see [gradle.org/contribute](https://gradle.org/contribute).

## Reporting problems

If you find a problem with this release, please file a bug on [GitHub Issues](https://github.com/gradle/gradle/issues) adhering to our issue guidelines.
If you're not sure you're encountering a bug, please use the [forum](https://discuss.gradle.org/c/help-discuss).

We hope you will build happiness with Gradle, and we look forward to your feedback via [Twitter](https://twitter.com/gradle) or on [GitHub](https://github.com/gradle).
104 changes: 104 additions & 0 deletions p1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
The Gradle team is excited to announce Gradle @version@.

This release features [1](), [2](), ... [n](), and more.

<!--
Include only their name, impactful features should be called out separately below.
[Some person](https://github.com/some-person)

THiS LIST SHOULD BE ALPHABETIZED BY [PERSON NAME] - the docs:updateContributorsInReleaseNotes task will enforce this ordering, which is case-insensitive.
-->
We would like to thank the following community members for their contributions to this release of Gradle:

## Upgrade instructions

Switch your build to use Gradle @version@ by updating your wrapper:

`./gradlew wrapper --gradle-version=@version@`

See the [Gradle 8.x upgrade guide](userguide/upgrading_version_8.html#changes_@baseVersion@) to learn about deprecations, breaking changes and other considerations when upgrading to Gradle @version@.

For Java, Groovy, Kotlin and Android compatibility, see the [full compatibility notes](userguide/compatibility.html).

## New features and usability improvements

<!-- Do not add breaking changes or deprecations here! Add them to the upgrade guide instead. -->

<!--

================== TEMPLATE ==============================

<a name="FILL-IN-KEY-AREA"></a>
### FILL-IN-KEY-AREA improvements

<<<FILL IN CONTEXT FOR KEY AREA>>>
Example:
> The [configuration cache](userguide/configuration_cache.html) improves build performance by caching the result of
> the configuration phase. Using the configuration cache, Gradle can skip the configuration phase entirely when
> nothing that affects the build configuration has changed.

#### FILL-IN-FEATURE
> HIGHLIGHT the usecase or existing problem the feature solves
> EXPLAIN how the new release addresses that problem or use case
> PROVIDE a screenshot or snippet illustrating the new feature, if applicable
> LINK to the full documentation for more details

================== END TEMPLATE ==========================


==========================================================
ADD RELEASE FEATURES BELOW
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv -->



### Dry run mode for test execution

It is now possible to run a test without actual test execution.

This can be useful for quickly verifying which tests will run when [filtering a test suite](userguide/java_testing.html#test_filtering).

Dry run mode can be enabled by either the `--test-dry-run` command-line option or via the [dryRun](dsl/org.gradle.api.tasks.testing.Test.html#org.gradle.api.tasks.testing.Test:dryRun) property.

This mode is compatible with the JUnit and TestNG frameworks.

<!-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ADD RELEASE FEATURES ABOVE
==========================================================

-->

## Promoted features
Promoted features are features that were incubating in previous versions of Gradle but are now supported and subject to backwards compatibility.
See the User Manual section on the “[Feature Lifecycle](userguide/feature_lifecycle.html)” for more information.

The following are the features that have been promoted in this Gradle release.

<!--
### Example promoted
-->

## Fixed issues

<!--
This section will be populated automatically
-->

## Known issues

Known issues are problems that were discovered post release that are directly related to changes made in this release.

<!--
This section will be populated automatically
-->

## External contributions

We love getting contributions from the Gradle community. For information on contributing, please see [gradle.org/contribute](https://gradle.org/contribute).

## Reporting problems

If you find a problem with this release, please file a bug on [GitHub Issues](https://github.com/gradle/gradle/issues) adhering to our issue guidelines.
If you're not sure you're encountering a bug, please use the [forum](https://discuss.gradle.org/c/help-discuss).

We hope you will build happiness with Gradle, and we look forward to your feedback via [Twitter](https://twitter.com/gradle) or on [GitHub](https://github.com/gradle).
Loading
Loading