Skip to content

ci: optimize pull request checks - #6938

Merged
kuny0707 merged 2 commits into
tronprotocol:release_v4.8.3from
bladehan1:feature/ci_refactor
Sep 18, 2026
Merged

kuny0707 merged 2 commits into
tronprotocol:release_v4.8.3from
bladehan1:feature/ci_refactor

Conversation

@bladehan1

@bladehan1 bladehan1 commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

What does this PR do?

  • Remove four invocation-wide --no-build-cache flags from Debian and Coverage Base builds and RocksDB tests.
  • Require PR titles to follow type(scope): description, including a space immediately after the colon, and provide a dedicated error when that space is missing.
  • Route a bare ci: description title to the existing ci reviewer scope; explicit scopes still take precedence and other bare types retain default reviewers.

Why are these changes required?

The repository already enables Gradle Build Cache. However, four x86 Gradle invocations disable task-output cache reads and writes globally. Removing those flags enables reuse for eligible compile, package, Checkstyle, and test tasks.

CONTRIBUTING.md requires the type: description or type(scope): description format and states that CI enforces it. Requiring the space after the colon keeps validation consistent with the documented rule, while the dedicated error makes the correction explicit.

Since ci is also an existing reviewer scope, a bare ci type can be mapped without inventing mappings for unrelated types.

This PR has been tested by:

  • YAML AST parsing for .github/workflows/pr-build.yml, .github/workflows/pr-check.yml, and .github/workflows/pr-reviewer.yml
  • Shell validation of 12 positive and negative PR-title cases across 1,000 rounds, totaling 12,000 assertions
  • Reviewer extraction cases for explicit scopes, bare ci, and other bare types
  • Verification that the four x86 commands no longer contain --no-build-cache
  • git diff --check
  • Forced local execution without task-cache reuse: ./gradlew -g /private/tmp/java-tron-gradle-home :framework:checkstyleMain :framework:checkstyleTest :plugins:checkstyleMain --no-daemon --no-build-cache
  • Local :framework:testWithRocksDb cache validation: an identical-input clean run restored the task FROM-CACHE; changing -DrunPrecompileBenchmark=true caused the task to execute while unrelated eligible tasks remained cached

Follow up

  • Use task-specific --rerun if a future test contract requires real execution for every CI run.

Extra details

  • Gradle Build Cache is already enabled repository-wide: org.gradle.caching=true is specified in the committed gradle.properties at the repository root (present on the base branch, not introduced by this PR). The Gradle build cache is disabled by default, and Gradle reads this file automatically, so no command-line flag or environment change is required. This PR only removes the four invocation-level --no-build-cache overrides that were suppressing that baseline configuration.
  • clean removes project build/ output but does not remove $GRADLE_USER_HOME/caches/build-cache-1; eligible outputs can therefore be restored after clean.
  • This PR does not change node runtime, consensus, state, database, RPC, configuration, or protocol behavior.

enable task-output caching for x86 build and coverage jobs
align PR title validation and reviewer routing with contributing rules
Comment thread .github/workflows/pr-check.yml Outdated
@halibobo1205 halibobo1205 added this to the GreatVoyage-v4.8.3 milestone Sep 4, 2026
@bladehan1
bladehan1 changed the base branch from develop to release_v4.8.3 September 17, 2026 06:10

- name: Build
run: ./gradlew clean build --no-daemon --no-build-cache
run: ./gradlew clean build --no-daemon

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is recommended to state in the PR description that org.gradle.caching=true has already been specified in gradle.properties, so that users are aware of the environment configuration.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified and done. org.gradle.caching=true is present in the committed gradle.properties on the base branch (release_v4.8.3) — it predates this PR, and since the Gradle build cache is disabled by default, this committed property is exactly what enables it. The PR description now states this explicitly under "Extra details".

@kuny0707
kuny0707 merged commit 34d00c5 into tronprotocol:release_v4.8.3 Sep 18, 2026
26 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants