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

chore: link PRs to linear issues #3191

Closed
wants to merge 17 commits into from
Closed

Conversation

nedsalk
Copy link
Contributor

@nedsalk nedsalk commented Sep 20, 2024

Summary

  • Huge shoutout to @maschad who kindly solved my browser testing problems!

This PR adds a workflow which automatically links PRs to the corresponding linear issues by updating the body of the PR with markdown comments that contain linear-related magic words. The implementation supports all the GitHub magic words (closes, fixes, etc.). If one wants to relate a PR to an issue without setting it as closing for that issue, they can add a "relates to", "related to", or "part of" like this:

  • Relates to #ISSUE1
  • Related to #ISSUE2
  • Part of #ISSUE3

Besides linking issues, I also implemented unlinking issues for cases where somebody erroneously links the wrong issue in GitHub (e.g. wanted to close #ISSUE2 but wrote that it closes #ISSUE1). This isn't automatically handled by linear when the referenced linear issue's identifier is removed from the body of the PR, so I had to call the linearClient.deleteAttachment endpoint directly in these cases.

I initially wanted to implement both linking and unlinking not by modifying the body of the PR but rather by using the API provided by the linear client, but then I realized that doing it like that doesn't add the metadata that gets added when using linear magic words.

Checklist

  • All changes are covered by tests (or not applicable)
  • All changes are documented (or not applicable)
  • I reviewed the entire PR myself (preferably, on GH UI)
  • I described all Breaking Changes (or there's none)

@nedsalk nedsalk added the chore Issue is a chore label Sep 20, 2024
@nedsalk nedsalk self-assigned this Sep 20, 2024
Copy link

vercel bot commented Sep 20, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
create-fuels-template ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 24, 2024 0:12am
ts-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 24, 2024 0:12am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
create-fuels-counter-example ⬜️ Ignored (Inspect) Sep 24, 2024 0:12am

Copy link

codspeed-hq bot commented Sep 20, 2024

CodSpeed Performance Report

Merging #3191 will improve performances by ×2.7

Comparing ns/chore/linear-integration (315c2f8) with master (11d5fd6)

Summary

⚡ 2 improvements
✅ 19 untouched benchmarks

Benchmarks breakdown

Benchmark master ns/chore/linear-integration Change
Instantiate a new Unlocked wallet 103.1 ms 38.4 ms ×2.7
Instantiate from an address 31.5 ms 28.5 ms +10.36%

scripts/linear/pr-to-linear-linker.ts Outdated Show resolved Hide resolved
scripts/linear/pr-to-linear-linker.ts Outdated Show resolved Hide resolved
scripts/linear/pr-to-linear-linker.ts Show resolved Hide resolved
scripts/tests-find.sh Show resolved Hide resolved
Copy link
Contributor

Coverage Report:

Lines Branches Functions Statements
77.17%(+0%) 71.81%(+0%) 75.77%(+0%) 77.28%(+0%)
Changed Files:

Coverage values did not change👌.

@nedsalk
Copy link
Contributor Author

nedsalk commented Sep 25, 2024

Superseded by FuelLabs/github-actions#40.

@nedsalk nedsalk closed this Sep 25, 2024
@arboleya arboleya deleted the ns/chore/linear-integration branch September 25, 2024 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Issue is a chore
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automatic Linear x Github PR integration
3 participants