Skip to content

[DO NOT MERGE] Reduce git fetch time for scalpel in GitHub actions - #26088

Draft
apupier wants to merge 2 commits into
apache:mainfrom
apupier:reduceGitFetchTimeForScalpel
Draft

[DO NOT MERGE] Reduce git fetch time for scalpel in GitHub actions#26088
apupier wants to merge 2 commits into
apache:mainfrom
apupier:reduceGitFetchTimeForScalpel

Conversation

@apupier

@apupier apupier commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

currently it takes almost 5 minutes. it seems that the git fetch --deepen=50 is fetching last 50 commits of all tags and branches. We only need from the base branch.
Locally, it goes from around 5 minutes to few seconds.

Description

Target

  • I checked that the commit is targeting the correct branch (Camel 4 uses the main branch)

Tracking

  • If this is a large change, bug fix, or code improvement, I checked there is a JIRA issue filed for the change (usually before you start working on it).

Apache Camel coding standards and style

  • I checked that each commit in the pull request has a meaningful subject line and body.
  • I have run mvn clean install -DskipTests locally from root folder and I have committed all auto-generated changes.

AI-assisted contributions

  • If this PR includes AI-generated code, commits have proper co-authorship attribution (e.g., Co-authored-by trailers) and the PR description identifies the AI tool used.

currently it takes almost 5 minutes. it seems that the `git fetch
--deepen=50` is fetching last 50 commits of all tags and branches. We
only need from the base branch.
Locally, it goes from around 5 minutes to few seconds.

Signed-off-by: Aurélien Pupier <apupier@ibm.com>
@apupier

apupier commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

need to validate on CI with the variables that it works fine

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟
🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run
  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot although they are normally detected and executed by CI.
  • You can label PRs using skip-tests and test-dependents to fine-tune the checks executed by this PR.
  • Build and test logs are available in the summary page. Only Apache Camel committers have access to the summary.

⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

Signed-off-by: Aurélien Pupier <apupier@ibm.com>
BASE_REF="${GITHUB_BASE_REF:-main}"
for depth in 50 200 1000; do
git fetch --deepen=$depth 2>/dev/null || true
git fetch --no-tags --deepen=$depth origin ${BASE_REF} 2>/dev/null || true

@apupier apupier Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Is it the base_ref or the target pull_request branch (so here main) that we would like to compare?

@gnodet ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

(note that ${BASE_REF} is not working)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant