Skip to content

feat: add OpenIn option to coder_app #15743

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

Merged
merged 29 commits into from
Jan 3, 2025
Merged

feat: add OpenIn option to coder_app #15743

merged 29 commits into from
Jan 3, 2025

Conversation

defelmnq
Copy link
Contributor

@defelmnq defelmnq commented Dec 4, 2024

This PR is the coder/coder part of the open_in parameter issue aiming to add a new optional parameter to choose how to open modules.

This PR is heavily linked to this PR.

ℹ️ For now, some integrations tests can not be pushed as it requires a release on the terraform-provider repo.

@defelmnq defelmnq self-assigned this Dec 4, 2024
@github-actions github-actions bot added the stale This issue is like stale bread. label Dec 12, 2024
@github-actions github-actions bot closed this Dec 15, 2024
@johnstcn johnstcn reopened this Dec 16, 2024
@github-actions github-actions bot removed the stale This issue is like stale bread. label Dec 17, 2024
@defelmnq defelmnq changed the title Add OpenIn option to coder_app feat: add OpenIn option to coder_app Dec 17, 2024
@defelmnq defelmnq marked this pull request as ready for review December 18, 2024 14:41
@defelmnq defelmnq requested review from mtojek and removed request for spikecurtis December 18, 2024 14:41
Copy link
Member

@mtojek mtojek left a comment

Choose a reason for hiding this comment

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

Nice work! LGTM 👍 ... but please wait for double-check from @johnstcn

You may want to mention the next steps like:

  • adjust Coder UI
  • update the dependency on terraform-provider-coder
  • etc.

johnstcn
johnstcn previously approved these changes Dec 19, 2024
Copy link
Member

@johnstcn johnstcn left a comment

Choose a reason for hiding this comment

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

LGTM, only suggestion I have is to define open_in as an enum instead, similar to how some other fields of the table are defined.

@defelmnq
Copy link
Contributor Author

defelmnq commented Dec 23, 2024

@mtojek @johnstcn I modified a lot of the code since your last review to add :

  • Enum on the database
  • Enum in proto files in the protosdk

Can I ask you for another stamp ? 🙏

CI is ok but just waiting for storybook review (which are false positive, nothing changed.)

@defelmnq defelmnq requested review from johnstcn and mtojek December 23, 2024 22:34
@mtojek
Copy link
Member

mtojek commented Dec 24, 2024

I reviewed Storybook images and they seem to be correct 👍

Copy link
Member

Choose a reason for hiding this comment

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

When adding a new field to this protobuf, you will need to increment provisionerd.proto.CurrentMinor.

Copy link
Member

Choose a reason for hiding this comment

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

TIL - is it documented somewhere? I believe there is no linting rule.

Copy link
Member

Choose a reason for hiding this comment

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

I'm second-guessing myself now -- we definitely need to increment minor version when adding a new RPC method.

Copy link
Member

Choose a reason for hiding this comment

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

Yep, no need to increment here. Sorry for the confusion!

Copy link
Contributor

Choose a reason for hiding this comment

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

We do need to increment the minor version:

https://www.notion.so/coderhq/API-Changes-Back-Compatibility-36e779e691e140d4a3dcb78700c6d0bf?pvs=4#21fc01f1d65847d1a2cff6a2558def76

This is a new feature, not a bug fix, so it gets a minor version increment.

Copy link
Member

Choose a reason for hiding this comment

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

Apologies for the confusion! I opened a separate PR to add some guidelines so we don't get confused about this in future: #16009

@@ -2559,6 +2559,7 @@ export interface WorkspaceApp {
readonly healthcheck: Healthcheck;
readonly health: WorkspaceAppHealth;
readonly hidden: boolean;
readonly open_in: string;
Copy link
Member

Choose a reason for hiding this comment

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

Defining this as a typed const in the Go code will mean this becomes a proper type in the generated TypeScript code.

Copy link
Member

Choose a reason for hiding this comment

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

I think we'll also need to create a new ConnectRPC24 method in codersdk/agentsdk to handle this new field, which defines an API version of major = 2 and minor = 4 adding this new field. Correct if I'm wrong @spikecurtis ?

Copy link
Member

Choose a reason for hiding this comment

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

Looking through #15508 again, it looks like I'm making much ado about nothing. We only need to bump the version when we modify the method interface, but adding a struct field to a proto shouldn't cause any issues. Please disregard the above comment.

@johnstcn johnstcn dismissed their stale review December 24, 2024 09:33

bump api versions

Copy link
Member

@johnstcn johnstcn left a comment

Choose a reason for hiding this comment

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

requesting changes to clarify changes to api versions

Copy link
Member

@johnstcn johnstcn left a comment

Choose a reason for hiding this comment

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

Clarified api version changes. I think we still should define the externally-facing codersdk field as a typed const, but I think that's the last piece. Re-approving to un-block.

Copy link
Member

Choose a reason for hiding this comment

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

Looking through #15508 again, it looks like I'm making much ado about nothing. We only need to bump the version when we modify the method interface, but adding a struct field to a proto shouldn't cause any issues. Please disregard the above comment.

Copy link
Member

Choose a reason for hiding this comment

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

Yep, no need to increment here. Sorry for the confusion!

@github-actions github-actions bot added the stale This issue is like stale bread. label Jan 1, 2025
Copy link
Contributor

Choose a reason for hiding this comment

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

We do need to increment the minor version:

https://www.notion.so/coderhq/API-Changes-Back-Compatibility-36e779e691e140d4a3dcb78700c6d0bf?pvs=4#21fc01f1d65847d1a2cff6a2558def76

This is a new feature, not a bug fix, so it gets a minor version increment.

@@ -100,7 +100,7 @@ require (
github.com/coder/quartz v0.1.2
github.com/coder/retry v1.5.1
github.com/coder/serpent v0.10.0
github.com/coder/terraform-provider-coder v1.0.2
github.com/coder/terraform-provider-coder v1.0.4
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this go to v2.1.0?

Copy link
Member

Choose a reason for hiding this comment

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

@defelmnq I am certainly not familiar with the code base as you but why we are still on version 1.0.4 of provider here?

@github-actions github-actions bot removed the stale This issue is like stale bread. label Jan 3, 2025
@defelmnq defelmnq requested a review from spikecurtis January 3, 2025 02:39
Copy link
Contributor Author

@defelmnq defelmnq left a comment

Choose a reason for hiding this comment

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

All comments should be fixed and the PR ready to merge - I tested in dogfood and everything's working.

cc @spikecurtis for the version bump.

Copy link
Contributor

@spikecurtis spikecurtis left a comment

Choose a reason for hiding this comment

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

One comment inline, but I don't need to review again.

@defelmnq defelmnq merged commit 08463c2 into main Jan 3, 2025
33 of 34 checks passed
@defelmnq defelmnq deleted the coder_app-open_in branch January 3, 2025 10:27
@github-actions github-actions bot locked and limited conversation to collaborators Jan 3, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants