-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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
chore(scaffolder-backend-module-gitlab): Upgrade to gitbeaker ^41.2.0 #27581
chore(scaffolder-backend-module-gitlab): Upgrade to gitbeaker ^41.2.0 #27581
Conversation
Changed Packages
|
Thanks for the contribution! |
050efe6
to
ecef3cf
Compare
do you know if this update would fix the error messages from GitLab (as I reported in #27600) For example when trying to create a branch via the API, if there are branch name rules configured, the error message is added to a |
Hi @CptnFizzbin |
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.
Alright, looking good, just minor questions
| 'write_registry' | ||
| 'read_package_registry' | ||
| 'write_package_registry' | ||
)[]; |
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.
Hm. Is this a good thing being the specific strings? Is this truly the only possible scopes now and forever? :)
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.
Up to you guys :) Having it as string allows "unwanted" behaviour for now, but of course the user will quickly realize.
I'm happy to leave it as a string
. Should I cast it as DeployTokenScope
in createGitlabProjectDeployTokenAction
when calling api.DeployTokens.create
?
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.
might be good to list out the known good ones, and have | string
tagged onto the end. Would allow intellisense to suggest these values, while also providing an escape hatch (and type hints) that there could be more options in the future.
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.
Yep that's a good middle ground. Will still need a cast internally but is useful to the end user.
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.
Can you give me a hand on this, guys? TS considers some types as "subtypes" of others. For instance:
let a: string | "read_repository" | "read_registry" | "write_registry" | "read_package_registry" | "write_package_registry";
is equivalent (in VSCode suggestions) to:
let a: string;
With zod
, these types would be generated with:
scopes: z.array(
z.union([
z.enum([
'read_repository',
'read_registry',
'write_registry',
'read_package_registry',
'write_package_registry',
]),
z.string()
]),
{ description: 'Scopes' },
But I get no benefit with intellisense, and the API report will declare string[]
.
I'm good with reverting it to string[]
. It looks like the only viable alternative.
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'm pushing it with string[]
for now. If you like it, we continue like that. Otherwise let me know and I change it to DeployTokenScope[]
(or maybe a 3rd 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.
leaving it as string[]
is probably our best bet
commitAction?: 'auto' | 'update' | 'delete' | 'create' | 'skip' | undefined | ||
/** | ||
* @public | ||
* @deprecated use import from `@backstage/plugin-scaffolder-backend-module-github` instead |
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.
Wait where did this come from? :) I don't think I see it elsewhere in the code and this is an autogenerated file eh?
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.
Indeed, it was generated automatically! 😕 It has nothing to do with my changes, that's why I kept it in a separate commit.. However, if I remember correctly, CI was checking that these api reports in my code match the generated ones, and this one didn't.
I can delete this, but I'm pretty sure it'll fail in CI.
How can I proceed?
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.
Nah leave it in if that's how it got generated. Curious thing tho 🤔
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.
Now it wasn't added anymore by the api report generator.. weird 🤷
seems to need a rebase now too after the other PR got merged |
Signed-off-by: mpsanchis <miguelpsanchis@gmail.com>
ecef3cf
to
08249ce
Compare
…eports Signed-off-by: mpsanchis <miguelpsanchis@gmail.com>
08249ce
to
f84dba3
Compare
@CptnFizzbin & @freben it seems that CI is green now 😄 Do we stay with the current state? Or do you want something else from my side? |
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
Thank you for contributing to Backstage! The changes in this pull request will be part of the |
Hey, I just made a Pull Request!
Upgrade gitbeaker to
^41.2.0
(major version) inscaffolder-backend-module-gitlab
.First split of #27360 as requested.
✔️ Checklist
Signed-off-by
line in the message. (more info)