-
Notifications
You must be signed in to change notification settings - Fork 330
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
feat: ✨ add new command 'm365 pp pipeline list' to list Powe… #6434
base: main
Are you sure you want to change the base?
Conversation
Thank you @DevPio m, we'll try to review it ASAP! |
@DevPio I added the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @DevPio, I've reviewed your PR, let's fix some issues before we move on!
```sh | ||
m365 pp pipeline list [options] | ||
``` | ||
`-e, --environment <environment>` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think something got deleted here. We're missing an Options header and some characters.
@@ -31,5 +31,6 @@ export default { | |||
SOLUTION_PUBLISHER_LIST: `${prefix} solution publisher list`, | |||
SOLUTION_PUBLISHER_REMOVE: `${prefix} solution publisher remove`, | |||
TENANT_SETTINGS_LIST: `${prefix} tenant settings list`, | |||
TENANT_SETTINGS_SET: `${prefix} tenant settings set` | |||
TENANT_SETTINGS_SET: `${prefix} tenant settings set`, | |||
PIPELINE_LIST: `${prefix} pipeline list` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's put this in the alphabetically sorted correct place
@@ -1,5 +1,6 @@ | |||
import type { SidebarsConfig } from '@docusaurus/plugin-content-docs'; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you added a white line here by accident. Let's remove it.
@@ -1786,6 +1787,15 @@ const sidebars: SidebarsConfig = { | |||
} | |||
] | |||
}, | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's put the pipeline section in the alphabetically sorted location (before s)
import GlobalOptions from '../../../../GlobalOptions.js'; | ||
import request, { CliRequestOptions } from '../../../../request.js'; | ||
import { formatting } from '../../../../utils/formatting.js'; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's remove this white line
public async commandAction(logger: Logger, args: any): Promise<void> { | ||
|
||
try { | ||
const environmentDetails = await this.getEnvironmentDetails(args.options.environmentName, args.options.asAdmin); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All other pp commands use an existing piece of code to retrieve the instanceUrl. Can't we just use that here instead of coding a new function?
const dynamicsApiUrl = await powerPlatform.getDynamicsInstanceApiUrl(args.options.environmentName, args.options.asAdmin);
catch (ex: any) { | ||
this.handleRejectedODataJsonPromise(ex); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's remove superfluous line breaks
responseType: 'json' | ||
}; | ||
const pipelines = await request.get<any>(pipelineListRequestOptions); | ||
return pipelines.value.map((p: any) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use white lines in select places for readability:
- Before a return statement
- Before and after new 'scopes', like if-statements, loops, functions, etc.
const pipelines = await request.get<any>(pipelineListRequestOptions); | ||
return pipelines.value.map((p: any) => { | ||
|
||
return { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of limiting the number of properties we return, let's just return the entire api output.
The defaultproperties section will influence what columns will be visible in text outputs. But in Json output we'll be able to view it all, which is probably better.
import { sinonUtil } from '../../../../utils/sinonUtil.js'; | ||
import { accessToken } from '../../../../utils/accessToken.js'; | ||
import { CommandError } from "../../../../Command.js"; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's remove superfluous white lines
Closes #6287