upcoming: [UIE-9343] - Add API endpoints and types for /v4/images/sharegroups/members and /v4/images/sharegroups/tokens#12984
Conversation
abailly-akamai
left a comment
There was a problem hiding this comment.
Looks good, thx for the clean code and good conventions
Left a few comments to consider to wrap this up
packages/api-v4/src/images/images.ts
Outdated
| setParams(params), | ||
| setXFilter(filters), | ||
| ); | ||
| }; |
There was a problem hiding this comment.
I don't think it makes sense to isolate this particular endpoint under images.
It belongs to the sharegroups namespace
There was a problem hiding this comment.
We should be consistent with the file naming as well (all lower caps)
There was a problem hiding this comment.
I did find nodePool.ts to follow the camelCasing though 🤔
There was a problem hiding this comment.
Right but nodePool is camel case everywhere. this file name is the only instance of shareGroups being camel case
It's not a big deal, just a consistency nit. does not matter much to me
| sharegroupId: string, | ||
| imageId: string, | ||
| data: UpdateSharegroupImagePayload, | ||
| ) => { |
There was a problem hiding this comment.
In general try to use named arguments above two parameters, along with an interface
interface UpdateSharegroupImage {
sharegroupId: string;
imageId: string;
data: UpdateSharegroupImagePayload;
}
export const updateSharegroupImage = ({
sharegroupId,
imageId,
data,
}: UpdateSharegroupImage) => {
[...]…s/sharegroups/members` and `/v4beta/images/sharegroups/tokens`
|
@harsh-akamai also don't forget your changesets, exp for new endpoints |
/v4/images/sharegroups/v4beta/images/sharegroups/members and /v4beta/images/sharegroups/tokens
/v4beta/images/sharegroups/members and /v4beta/images/sharegroups/tokens/v4/images/sharegroups/members and /v4/images/sharegroups/tokens
…/harsh-akamai/manager into UIE-9311-add-endpoints-to-images
| ) => { | ||
| Request<Page<SharegroupMember>>( | ||
| setURL( | ||
| `${BETA_API_ROOT}/images/sharegroup/${encodeURIComponent(sharegroupId)}/members`, |
There was a problem hiding this comment.
| `${BETA_API_ROOT}/images/sharegroup/${encodeURIComponent(sharegroupId)}/members`, | |
| `${BETA_API_ROOT}/images/sharegroups/${encodeURIComponent(sharegroupId)}/members`, |
same here
| data: GenerateSharegroupTokenPayload, | ||
| ) => { | ||
| return Request<SharegroupToken>( | ||
| setURL(`${BETA_API_ROOT}/images/sharegroup/tokens`), |
There was a problem hiding this comment.
| setURL(`${BETA_API_ROOT}/images/sharegroup/tokens`), | |
| setURL(`${BETA_API_ROOT}/images/sharegroups/tokens`), |
I think this should be sharegroups (per the specs). Could you double-check?
| ) => { | ||
| Request<SharegroupMember>( | ||
| setURL( | ||
| `${BETA_API_ROOT}/images/sharegroup/${encodeURIComponent(sharegroupId)}/members/${encodeURIComponent(token_uuid)}`, |
There was a problem hiding this comment.
| `${BETA_API_ROOT}/images/sharegroup/${encodeURIComponent(sharegroupId)}/members/${encodeURIComponent(token_uuid)}`, | |
| `${BETA_API_ROOT}/images/sharegroups/${encodeURIComponent(sharegroupId)}/members/${encodeURIComponent(token_uuid)}`, |
packages/api-v4/src/images/types.ts
Outdated
| source_image_id: number; | ||
| }; | ||
| shared_with: null | { | ||
| shared_count: number; |
There was a problem hiding this comment.
| shared_count: number; | |
| sharegroup_count: number; |
I think this should be sharegroup_count
| sharegroup_label: string; | ||
| sharegroup_uuid: string; |
There was a problem hiding this comment.
| sharegroup_label: string; | |
| sharegroup_uuid: string; | |
| share_group_label: string; | |
| share_group_uuid: string; |
There was a problem hiding this comment.
APIs seem to be returning sharegroup_label and sharegroup_uuid. I've posted a question in the APISpec for clarification
There was a problem hiding this comment.
Verified: The api returns sharegroup_label and sharegroup_uuid
…nd `/v4/images/sharegroups/tokens`
…regroup Members and Tokens
Cloud Manager UI test results🔺 3 failing tests on test run #9 ↗︎
Details
TroubleshootingUse this command to re-run the failing tests: pnpm cy:run -s "cypress/e2e/core/firewalls/firewall-landing-page.spec.ts,cypress/e2e/core/firewalls/create-firewall.spec.ts,cypress/e2e/core/linodes/clone-linode.spec.ts" |
|||||||||||||||||||||||
…aregroups/members` and `/v4/images/sharegroups/tokens` (linode#12984) * upcoming: [UIE-9311] - Add API endpoints and types for `/v4/images/sharegroups` * Add validation schema * upcoming: [UIE-9343] - Add API endpoints and types for `/v4beta/images/sharegroups/members` and `/v4beta/images/sharegroups/tokens` * rename sharegroup.ts * add named arguments for functions with more than 2 parameters * pr split + validation schema separation * PR feedback @pmakode-akamai * Added changeset: Add endpoints for `/v4/images/sharegroups/members` and `/v4/images/sharegroups/tokens` * Added changeset: Add validation schemas for creating and updating Sharegroup Members and Tokens
Description 📝
Add new /v4beta/images/sharegroups/members & /v4beta/images/sharegroups/tokens endpoints for Private Image Sharing feature
This is part of a 2 PR split that covers all the endpoints, validation and type changes for the new Private Image Sharing feature (PR #2)
Changes 🔄
This PR covers the CRUD endpoints for Sharegroup members and tokens
Scope 🚢
Upon production release, changes in this PR will be visible to:
How to test 🧪
Verification steps
Author Checklists
As an Author, to speed up the review process, I considered 🤔
👀 Doing a self review
❔ Our contribution guidelines
🤏 Splitting feature into small PRs
➕ Adding a changeset
🧪 Providing/improving test coverage
🔐 Removing all sensitive information from the code and PR description
🚩 Using a feature flag to protect the release
👣 Providing comprehensive reproduction steps
📑 Providing or updating our documentation
🕛 Scheduling a pair reviewing session
📱 Providing mobile support
♿ Providing accessibility support
As an Author, before moving this PR from Draft to Open, I confirmed ✅