Skip to content

Conversation

beagins
Copy link
Contributor

@beagins beagins commented Apr 29, 2025

Description

  • update namespace-picker from javascript to typescript
  • enterprise tests passing

TODO only if you're a HashiCorp employee

  • Backport Labels: If this fix needs to be backported, use the appropriate backport/ label that matches the desired release branch. Note that in the CE repo, the latest release branch will look like backport/x.x.x, but older release branches will be backport/ent/x.x.x+ent.
    • LTS: If this fixes a critical security vulnerability or severity 1 bug, it will also need to be backported to the current LTS versions of Vault. To ensure this, use all available enterprise labels.
  • ENT Breakage: If this PR either 1) removes a public function OR 2) changes the signature
    of a public function, even if that change is in a CE file, double check that
    applying the patch for this PR to the ENT repo and running tests doesn't
    break any tests. Sometimes ENT only tests rely on public functions in CE
    files.
  • Jira: If this change has an associated Jira, it's referenced either
    in the PR description, commit message, or branch name.
  • RFC: If this change has an associated RFC, please link it in the description.
  • ENT PR: If this change has an associated ENT PR, please link it in the
    description. Also, make sure the changelog is in this PR, not in your ENT PR.

@github-actions github-actions bot added the hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed label Apr 29, 2025
@beagins beagins marked this pull request as ready for review April 29, 2025 03:55
@beagins beagins requested a review from a team as a code owner April 29, 2025 03:55
Copy link

github-actions bot commented Apr 29, 2025

CI Results:
All Go tests succeeded! ✅

Copy link

Build Results:
All builds succeeded! ✅

@beagins beagins force-pushed the VAULT-34216/namespace-picker-feature-branch branch from 7c57f56 to 3020877 Compare April 29, 2025 16:25
@beagins beagins requested a review from a team as a code owner April 29, 2025 16:25
@beagins beagins requested review from paymanblu and removed request for a team April 29, 2025 16:25
@beagins beagins force-pushed the VAULT-34216/to-typescript branch from 5cae053 to 3abe45c Compare April 29, 2025 16:26
Copy link
Contributor

@lane-wetmore lane-wetmore left a comment

Choose a reason for hiding this comment

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

Great job on this 🎉

@service declare auth: any;
@service declare namespace: any;
@service declare router: any;
@service declare store: any;
Copy link
Contributor

Choose a reason for hiding this comment

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

there is a type Store from '@ember-data/store', that I see used elsewhere, would that work here?

Suggested change
@service declare store: any;
@service declare store: Store;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for catching these!! They should all be addressed now :)

@service store;
@service declare auth: any;
@service declare namespace: any;
@service declare router: any;
Copy link
Contributor

Choose a reason for hiding this comment

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

There is also a type for Router we've used elsewhere, type Router from '@ember/routing/router'

Suggested change
@service declare router: any;
@service declare router: Router;

@service router;
@service store;
@service declare auth: any;
@service declare namespace: any;
Copy link
Contributor

Choose a reason for hiding this comment

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

Would type NamespaceService from 'vault/services/namespace' work for this type instead of any?

@service namespace;
@service router;
@service store;
@service declare auth: any;
Copy link
Contributor

Choose a reason for hiding this comment

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

would type AuthService from 'vault/services/auth' work for this type instead of any?


constructor() {
super(...arguments);
constructor(owner: unknown, args: any) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we define an Args interface for this type instead of any? Something like here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch! So we aren't currently passing anything into NamespacePicker, so args is empty, and lint complained about an empty interface, and when I looked it up, it should look something like:

constructor(owner: unknown, args: Record<string, never>) {

We'll introduce an interface later if/when we add args to NamespacePicker.

@lane-wetmore lane-wetmore removed the request for review from paymanblu April 29, 2025 19:28
@beagins beagins merged commit 4e6e871 into VAULT-34216/namespace-picker-feature-branch Apr 29, 2025
25 checks passed
@beagins beagins deleted the VAULT-34216/to-typescript branch April 29, 2025 21:09
beagins added a commit that referenced this pull request Apr 29, 2025
…30437)

* [VAULT-34483] updates from js to ts

* address PR comments
beagins added a commit that referenced this pull request Apr 30, 2025
…30437)

* [VAULT-34483] updates from js to ts

* address PR comments
beagins added a commit that referenced this pull request May 1, 2025
…30437)

* [VAULT-34483] updates from js to ts

* address PR comments
beagins added a commit that referenced this pull request May 1, 2025
…30437)

* [VAULT-34483] updates from js to ts

* address PR comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants