-
Notifications
You must be signed in to change notification settings - Fork 5
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
DP-1602 Add data pool export / batch import commands #133
Conversation
} | ||
|
||
public createPullManager(id: string, filename: string, pullVersion: number): DataPoolManager { | ||
const dataPoolManager = this.createBaseManager(id, filename); |
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.
nit: would we want to append ".json" if the user did not type it?
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.
Thank you. Could be a way, but I don't see this as an absolute necessity for now. If we get customer requests on this maybe we could add it later.
Also moving forward we are trying to migrate to a different architecture for the content-cli. We are using services to implement the functionality of each command. Could you migrate only the changes for batch push and pull to this approach? |
I adjusted according to the new architecture. 👍 |
@@ -19,14 +18,22 @@ export class FileService { | |||
} | |||
|
|||
public readManifestFile(importedFileName: string): Promise<ManifestNodeTransport[]> { | |||
const manifest: ManifestNodeTransport[] = YAML.parse(fs.readFileSync(path.resolve(importedFileName + "/manifest.yml"), { encoding: "utf-8" })); | |||
const manifest: ManifestNodeTransport[] = YAML.parse( |
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.
just prettifying
public static packages(program: CommanderStatic): CommanderStatic { | ||
program | ||
.command("packages") | ||
.description("Command to import all given packages") | ||
.option("-p, --profile <profile>", "Profile which you want to use to list packages") | ||
.option("--spaceMappings <spaceMappings...>", "List of mappings for importing packages to different target spaces. Mappings should follow format 'packageKey:targetSpaceKey'") | ||
.option( |
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.
just prettifying
request.post(this.resolveUrl(url) + "?" + querystring.stringify(parameters), this.makeOptions(contextService.getContext().profile, body), (err, res) => { | ||
this.handleResponse(res, resolve, reject); | ||
}); | ||
request.post( |
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.
just prettifying
request.get(this.resolveUrl(url), this.makeOptions(contextService.getContext().profile, null), (err, res) => { | ||
this.handleResponse(res, resolve, reject); | ||
}); | ||
request.get( |
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.
just prettifying
request.put(this.resolveUrl(url), this.makeOptionsJson(contextService.getContext().profile, JSON.stringify(body), "application/json;charset=utf-8"), (err, res) => { | ||
this.handleResponse(res, resolve, reject); | ||
}); | ||
request.put( |
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.
just prettifying
import * as commander from "commander"; | ||
|
||
export class ContextInitializer { | ||
public static async initContext(): Promise<void> { |
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.
copied into its own class to avoid repeating code.
}; | ||
|
||
ContextInitializer.initContext() | ||
.then(loadCommands, loadCommands) |
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.
Are we calling the loadCommands twice here? I haven't seen this syntax before/
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.
it's exactly as it was before, just instead of writting the () => { getCommands(); }
twice, I put it into a variable.
Description
Ticket: https://celonis.atlassian.net/browse/DP-1602
Added data pool batch push support
Added data pool export version 2, that's compatible with the data pool batch push.
Updated the documentation.
As already discussed in our meeting, the implementation will be adjusted to be more user-friendly. (ticket created: https://celonis.atlassian.net/browse/DP-1576)
For now, this request should be good for the Batch Import UI.
Import Data Pool
Export Data Pool
Checklist