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

Feature/shayel/add support for multi region param interactive #96

Conversation

ShayElkana
Copy link
Contributor

No description provided.

…param' into feature/shayel/add_support_for_multi_region_param_interactive

# Conflicts:
#	src/commands/code/status.ts
…param' into feature/shayel/add_support_for_multi_region_param_interactive

# Conflicts:
#	src/commands/app/deploy.ts
#	src/commands/code/env.ts
#	src/commands/code/logs.ts
#	src/commands/code/push.ts
#	src/commands/code/status.ts
#	src/commands/utils/region.ts
…param' into feature/shayel/add_support_for_multi_region_param_interactive

# Conflicts:
#	package.json
@ShayElkana ShayElkana changed the base branch from master to feature/shayel/add_support_for_multi_region_param May 29, 2024 16:30
Copy link
Contributor

@maorb-dev maorb-dev left a comment

Choose a reason for hiding this comment

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

Just a few comments.
for the version VS. versions - please double check what you get from the server, and rename/refactor some of the variables/functions to reflect

@@ -34,3 +38,43 @@ export function addRegionToFlags<T>(flags: T): T {

return flags;
}

const regionsPrompt = async () =>
PromptService.promptList('Choose region', [Region.US, Region.EU, Region.AU], Region.US);
Copy link
Contributor

Choose a reason for hiding this comment

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

does this use US as default? if so, why?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

US is the auto-selected option for the prompt
@maorb-dev

Copy link
Contributor

Choose a reason for hiding this comment

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

wdym? lets talk about this: @ShayElkana

try {
const path = getAppVersionsByAppIdUrl(appVersionId);
const url = appsUrlBuilder(path);
logger.debug(`fetching logs url: ${url}`);
Copy link
Contributor

Choose a reason for hiding this comment

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

wrong log

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why? it's for --verbose
we already have something like this
@maorb-dev

appVersionsSchema,
);

return response.appVersion;
Copy link
Contributor

Choose a reason for hiding this comment

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

is it response.appVersion ? or response.appVersions ? because this is an array

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why do you say it's returning an array this is a new endpoint that returns a single app version by id
@maorb-dev


export const appVersionsSchema = z
.object({
appVersion: appVersionSchema,
Copy link
Contributor

Choose a reason for hiding this comment

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

same comment - version? versions?


export type AppVersion = z.infer<typeof appVersionSchema>;
export type Version = z.infer<typeof appVersionsSchema>;
Copy link
Contributor

Choose a reason for hiding this comment

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

again same comment- 1 Version like the type, or versions schema?

@ShayElkana ShayElkana requested a review from maorb-dev June 2, 2024 12:05
Comment on lines 6 to 7
export type Version = z.infer<typeof appVersionHttpSchema>;
export type ListAppVersionsResponse = z.infer<typeof listAppVersionsSchema>;
Copy link
Contributor

Choose a reason for hiding this comment

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

line 7 is a good example- the schema is of the http response, and itself holds the schema of the entity. I would refactor like this:

Suggested change
export type Version = z.infer<typeof appVersionHttpSchema>;
export type ListAppVersionsResponse = z.infer<typeof listAppVersionsSchema>;
export type GetAppVersionResponse = z.infer<typeof getAppVersionSchema>;
export type ListAppVersionsResponse = z.infer<typeof listAppVersionsSchema>;

@@ -20,7 +20,7 @@ export const listAppVersionsSchema = z
})
.merge(baseResponseHttpMetaDataSchema);

export const appVersionsSchema = z
export const appVersionHttpSchema = z
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
export const appVersionHttpSchema = z
export const getAppVersionSchema = z

@ShayElkana ShayElkana merged commit ac5e8ce into feature/shayel/add_support_for_multi_region_param Jun 3, 2024
2 checks passed
ShayElkana added a commit that referenced this pull request Jun 3, 2024
* feature: add support for multi region param

* feature: add support for multi region param

* feature: add support for multi region param

* feature: add support for multi region param

* feature: add support for multi region param

* feature: add support for multi region param

* feature: add support for multi region param

* feature: add support for multi region param

* feature: add support for multi region param

* feature: add support for multi region param

* feature: add support for multi region param

* feature: add support for multi region param

* feature: add support for multi region param

* feature: add support for multi region param

* feature: add support for multi region param

* feature: update version

* feature: remove specific error

* feature: version#

* feature: [beta] mutli-region support basic cli flags

* feature: [beta] mutli-region support basic cli flags

* feature: [beta] fix imports

* Feature/shayel/add support for multi region param interactive (#96)

* feature: add support for multi region param

* feature: add support for multi region param

* feature: update version

* feature: [beta] added interactive

* feature: [beta] added interactive

* feature: [beta] added interactive

* feature: [beta] added interactive

* feature: [beta] added interactive

* feature: fix name of type

* feature: fix version

* feature: fix version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants