Skip to content

Conversation

@maorb-dev
Copy link
Contributor

@maorb-dev maorb-dev commented Nov 30, 2025

@maorb-dev maorb-dev self-assigned this Nov 30, 2025
Copy link
Contributor Author

@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.

lgtm

Copy link
Contributor

@Shaharshaki2 Shaharshaki2 left a comment

Choose a reason for hiding this comment

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

Overall looks good,
left some comments

package.json Outdated
{
"name": "@mondaycom/apps-cli",
"version": "4.9.3",
"version": "4.9.4",
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm gonna merge my "scanning-results" pr, so you'll probably need to change it

if (!appId) appId = await DynamicChoicesService.chooseApp();
const selectedRegion = await chooseRegionIfNeeded(parsedRegion, { appId });
if (!name) name = await DynamicChoicesService.chooseSchedulerJob(appId, selectedRegion);
const jobs = await SchedulerService.listJobs(appId, selectedRegion);
Copy link
Contributor

Choose a reason for hiding this comment

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

why did you added this? don't you do the exact same thing inside the DynamicChoicesService.chooseSchedulerJob function?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ahhh, I remember now.
the only reason we need the jobs is to validate that the name input matches an existing job, or otherwise it will end with 500.
so if the user doesnt input a job name, we are going to query for the jobs anyway, so we can return them from the inner function as well like you suggested.
BUT- if the user does input a name, we are not calling for "choose job" anyway, so we dont fetch jobs internally.

so either way, we need to fetch the job, so this change only makes sure we only do it once, not twice

async chooseSchedulerJob(appId: AppId, region?: Region) {
const jobs = await SchedulerService.listJobs(appId, region);
async chooseSchedulerJob(appId: AppId, region?: Region, jobs?: SchedulerJob[]) {
if (!jobs) jobs = await SchedulerService.listJobs(appId, region);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you don't need to get the jobs as an argument, just keep doing it inside the function like before.

Copy link
Contributor

@Shaharshaki2 Shaharshaki2 left a comment

Choose a reason for hiding this comment

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

lgtm, left comments

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.

3 participants