Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

dev/linearhooks: add support for project modifier#62521

Merged
michaellzc merged 1 commit into
mainfrom
05-07-dev_linearhooks_add_support_for_project_modifier
May 8, 2024
Merged

dev/linearhooks: add support for project modifier#62521
michaellzc merged 1 commit into
mainfrom
05-07-dev_linearhooks_add_support_for_project_modifier

Conversation

@michaellzc

@michaellzc michaellzc commented May 8, 2024

Copy link
Copy Markdown
Member

https://sourcegraph.slack.com/archives/C06GAS7FUGL/p1715062692858249

implements a modifier spec so we can override the project when moving the issue to another team

Test plan

added tests and manual testing.

@cla-bot cla-bot Bot added the cla-signed label May 8, 2024

Copy link
Copy Markdown
Member Author

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

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

@michaellzc michaellzc force-pushed the 05-07-dev_linearhooks_add_support_for_project_modifier branch 2 times, most recently from 05f7a8b to e1a235b Compare May 8, 2024 02:13
@michaellzc michaellzc marked this pull request as ready for review May 8, 2024 02:15
@michaellzc michaellzc requested a review from varungandhi-src May 8, 2024 02:15
@michaellzc michaellzc force-pushed the 05-07-dev_linearhooks_add_support_for_project_modifier branch from e1a235b to 928be72 Compare May 8, 2024 02:32

@varungandhi-src varungandhi-src left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Left some minor suggestions for simplification.

Comment thread dev/linearhooks/internal/handlers/handlers.go Outdated
Comment thread dev/linearhooks/internal/handlers/handlers.go Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
teamId: teamUUID,
teamUUID: teamUUID,

It's a bit confusing to use 'id' and 'UUID' interchangeably.

Comment thread dev/linearhooks/internal/lineargql/operations.graphql Outdated
Comment on lines 69 to 77

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It seems a bit weird that teamId above is another-team-uuid and below it is team-a-uuid. Are these deliberately different/why is this working if they're different? 🤔

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It seems a bit weird that teamId above is another-team-uuid and below it is team-a-uuid. Are these deliberately different/why is this working if they're different? 🤔

😅 it's a way to workaround for the shared global cache. otherwise, it's hard to assert the behavior.

I plan on refactoring the graphql client out of its standalone pkg. at least, during test, we can start from a clean state everytime

Comment thread dev/linearhooks/config.example.yaml Outdated
Comment on lines 16 to 20

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not entirely sure what the benefit is of an extra level of optionality here with 'modifier' (which is also a bit awkward name-wise); for example, GitHub Actions YAML mixes optional and non-optional keys together at the same 'level' in the tree. But it's not a big deal.

Is the point that problems with fields outside of modifier: will result in "hard errors" whereas problems with fields inside of modifier: will result in "soft errors"? If so, it would be useful to document that property on modifier: rather than on projectName:.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

yeah, that's the intention. modifer is a collection of best-effort modification we will make when moving the issue

Not entirely sure what the benefit is of an extra level of optionality here with 'modifier'

😂 I think I am too used to the craziness of k8s API. That said, I agree, we shouldn't have more too much nesting

@michaellzc michaellzc force-pushed the 05-07-dev_linearhooks_add_support_for_project_modifier branch 2 times, most recently from bc756dc to 0fd40e9 Compare May 8, 2024 03:28
@michaellzc michaellzc enabled auto-merge (squash) May 8, 2024 03:28
@michaellzc michaellzc force-pushed the 05-07-dev_linearhooks_add_support_for_project_modifier branch from 0fd40e9 to 48577fc Compare May 8, 2024 17:09
@michaellzc michaellzc merged commit 99dae35 into main May 8, 2024
@michaellzc michaellzc deleted the 05-07-dev_linearhooks_add_support_for_project_modifier branch May 8, 2024 17:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants