-
Notifications
You must be signed in to change notification settings - Fork 1
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
Support export files on partners #153
base: main
Are you sure you want to change the base?
Conversation
b15623a
to
9a0ea03
Compare
750a6d5
to
8a359aa
Compare
8a359aa
to
a69adcc
Compare
a69adcc
to
89bdcb9
Compare
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.
Updates look really good! 💯
I left some comments here and there.
About async/await: I guess we can keep it without await
for now since save
method is not async
.
You will need to update the CLI version again. And as a simply rule, if we make an update like this, we bump the MINOR number. If we do a bug fix, we bump the PATCH
Considering that v{MAJOR}.{MINOR}.{PATCH}
. https://semver.org/#summary
bin/cli.js
Outdated
@@ -207,7 +213,7 @@ program | |||
); | |||
} else if (options.all) { | |||
toolkit.publishAllExportFiles( | |||
settings.type, | |||
"firm", |
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.
This is inline all publicAll...
commands. But I'm not sure why we don't support that for Partners tbh.
Maybe something to tackle together with the create-
commands ticket?
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.
Also the error when running silverfin update-<any-template-type> --all --partner <id> --message "Update all
is not clear.
It is not saying it is not supported, it just says missing IDs.
I would vote for change it now, replace "firm" with type
and support it for every update-
command. What do you think?
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.
In the index.js file, we seemed to use the type already in the underlying functions, so is it correct that I only needed to change the "firm" to settings.type (4 times -> Reconciliations, export files, account templates, shared parts).
Since we are supporting it, we won't have to adjust the error either, I assume?
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 know I mentioned to remove the partner check, but later we decided to not support update-all and create-all on partners.
And I wonder if we should do that still in this PR, because if not we could still be releasing something not fully working?
keeping the fixed "firm"
parameter is not going to prevent going through the entire process when you select partners -> it will fail because of the wrong id (the firm id is not the partner id)
But I think we should do the right thing now, and implement the block for Partners in update/create all in here.
So a way to check if the option is partner and the command is update or create, and the flag is set to all. We block the process, show an error message, and don't run any further methods.
What do you think
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 left only one comment regarding partners and update/create all commands to decide what we do.
Besides that, everything looks good for me. Which takes me to the next point. Did someone else from the team did a functional testing? if not, we should do that
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.
Sorry @BenjaminLangenakenSF , but I would prefer to have all this conditions on /bin/cli.js
rather than index.js
I see this contrain related to the CLI commands & flags, so we add it there, while keeping the functionality 'clean'
If we ever support them, again we update CLI commands & flags.
What do you think?
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.
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.
Yes.
Or even cleaner (to avoid repeating always the same and adding multiple lines) we create a helper method like cliUtils.checkUniqueOption(["handle", "all"], options)
or cliUtils.checkDefaultFirm(options.firm, firmIdDefault)
where we pass options
E.g. cliUtils.checkPartnerSupport(options)
I believe the condition is options.all and options.type == partner, right?
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.
Thanks for the explanation Rufo, added a fixup commit 😉
Looks ok?
Description
Update to make sure that export files can be handled (imported & updated) on partners as well.
Note that the create commands were not yet added, since we have a separate ticket for that to cover all template types.
Fixes # [Liquid toolchain] - CLI - Support export files on Partners
Type of change
Checklist