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

ci: just fetch PR commits when linting messages #1026

Merged
merged 7 commits into from
Nov 7, 2024

Conversation

davidlj95
Copy link
Owner

@davidlj95 davidlj95 commented Nov 7, 2024

Issue or need

After reviewing how the linting tooling is setup to update another repository, saw that fetch-depth is set to 0 aka fetch everything. This is too much though. We only need the commits from the PR!

Proposed changes

Use several tricks to just fetch the appropriate depth:

  • Calculates number of commits + 1 to fetch only pull request commits. If it's not a pull request, the shell expression will be + 1 so just one will be fetched. As expected in the main case. The +1 is needed as otherwise the range doesn't exist given the pull request base isn't fetched, but it's included in the range. It has to be included, as the start from the range is needed, despite not inspected.
  • Use commitlint --last instead of commitlint --from HEAD~1. As if just fetching last commit in main, the HEAD~1 doesn't exist. As explained above.

Simulated both cases and everything goes fine

Quick reminders

  • 🤝 I will follow Code of Conduct
  • No existing pull request already does almost same changes
  • 👁️ Contributing docs are something I've taken a look at
  • 📝 Commit messages convention has been followed
  • 💬 TSDoc comments have been added or updated indicating API visibility if API surface has changed.
  • 🧪 Tests have been added if needed. For instance, if adding new features or fixing a bug. Or removed if removing features.
  • ⚙️ API Report has been updated if API surface is altered.

Copy link
Owner Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @davidlj95 and the rest of your teammates on Graphite Graphite

@davidlj95 davidlj95 marked this pull request as ready for review November 7, 2024 16:48
@davidlj95 davidlj95 enabled auto-merge (squash) November 7, 2024 16:48
Copy link

github-actions bot commented Nov 7, 2024

📦 Bundle size (Angular v18)

Git ref: 96b1e850f5861d4d6fea17c8fe4b6f7689af42fb

Module file Size Base size Difference
ngx-meta-core.mjs 3205 bytes (3.2KiB) Not available Not available
ngx-meta-json-ld.mjs 217 bytes (217B) Not available Not available
ngx-meta-open-graph.mjs 931 bytes (931B) Not available Not available
ngx-meta-routing.mjs 394 bytes (394B) Not available Not available
ngx-meta-standard.mjs 857 bytes (857B) Not available Not available
ngx-meta-twitter-card.mjs 487 bytes (487B) Not available Not available
Total 6091 bytes (6.0KiB) Not available Not available

Base size data is not available yet. Try again when the CI/CD has finished running on main branch

Copy link

github-actions bot commented Nov 7, 2024

📦 Bundle size (Angular v16)

Git ref: 96b1e850f5861d4d6fea17c8fe4b6f7689af42fb

Module file Size Base size Difference
ngx-meta-core.mjs 3467 bytes (3.4KiB) Not available Not available
ngx-meta-json-ld.mjs 201 bytes (201B) Not available Not available
ngx-meta-open-graph.mjs 870 bytes (870B) Not available Not available
ngx-meta-routing.mjs 379 bytes (379B) Not available Not available
ngx-meta-standard.mjs 808 bytes (808B) Not available Not available
ngx-meta-twitter-card.mjs 448 bytes (448B) Not available Not available
Total 6173 bytes (6.1KiB) Not available Not available

Base size data is not available yet. Try again when the CI/CD has finished running on main branch

Copy link

github-actions bot commented Nov 7, 2024

📦 Bundle size (Angular v17)

Git ref: 96b1e850f5861d4d6fea17c8fe4b6f7689af42fb

Module file Size Base size Difference
ngx-meta-core.mjs 3205 bytes (3.2KiB) Not available Not available
ngx-meta-json-ld.mjs 217 bytes (217B) Not available Not available
ngx-meta-open-graph.mjs 931 bytes (931B) Not available Not available
ngx-meta-routing.mjs 394 bytes (394B) Not available Not available
ngx-meta-standard.mjs 857 bytes (857B) Not available Not available
ngx-meta-twitter-card.mjs 487 bytes (487B) Not available Not available
Total 6091 bytes (6.0KiB) Not available Not available

Base size data is not available yet. Try again when the CI/CD has finished running on main branch

Copy link

github-actions bot commented Nov 7, 2024

📦 Bundle size (Angular v15)

Git ref: 96b1e850f5861d4d6fea17c8fe4b6f7689af42fb

Module file Size Base size Difference
ngx-meta-core.mjs 3384 bytes (3.4KiB) Not available Not available
ngx-meta-json-ld.mjs 206 bytes (206B) Not available Not available
ngx-meta-open-graph.mjs 870 bytes (870B) Not available Not available
ngx-meta-routing.mjs 373 bytes (373B) Not available Not available
ngx-meta-standard.mjs 808 bytes (808B) Not available Not available
ngx-meta-twitter-card.mjs 448 bytes (448B) Not available Not available
Total 6089 bytes (6.0KiB) Not available Not available

Base size data is not available yet. Try again when the CI/CD has finished running on main branch

Copy link

codecov bot commented Nov 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (3b6d10d) to head (96b1e85).
Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #1026   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           89        89           
  Lines          395       395           
  Branches        55        55           
=========================================
  Hits           395       395           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@davidlj95 davidlj95 merged commit 8725c28 into main Nov 7, 2024
35 checks passed
@davidlj95 davidlj95 deleted the stacked/ci-try-just-fetching-the-needed-depth branch November 7, 2024 16:55
@davidlj95 davidlj95 changed the title ci: try just fetching the needed depth ci: just fetch PR commits when linting messages Nov 7, 2024
Copy link

🎉 This PR is included in version 1.0.0-beta.32 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

1 participant