Skip to content
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

Gitlab: Upgrade @gitbeaker/node from ^21.3.0 to ^35.8.1 [platform] GitLab #1406

Merged
merged 6 commits into from
Sep 22, 2023

Conversation

buffcode
Copy link
Contributor

@buffcode buffcode commented Sep 21, 2023

This is a follow up to #1327 by @ivankatliarchuk

  • All tests have been fixed
  • This PR should allow for a smoother switch to @gitbeaker/rest (see [DEPS] Move from @gitbeaker/node to @gitbeaker/rest #1386)
  • esModuleInterop had to be enabled for DTS generation because of:
    /home/runner/work/danger-js/danger-js/node_modules/@gitbeaker/core/dist/types/infrastructure/Utils.d.ts:1:8 - Module '"/home/runner/work/danger-js/danger-js/node_modules/form-data/index"' can only be default-imported using the 'esModuleInterop' flag
    /home/runner/work/danger-js/danger-js/node_modules/@gitbeaker/requester-utils/dist/types/RequesterUtils.d.ts:2:8 - Module '"/home/runner/work/danger-js/danger-js/node_modules/form-data/index"' can only be default-imported using the 'esModuleInterop' flag
    

@buffcode buffcode changed the title Gitlab: Upgrade @gitbreaker/node from ^21.3.0 to ^35.8.1 [platform] GitLab Gitlab: Upgrade @gitbeaker/node from ^21.3.0 to ^35.8.1 [platform] GitLab Sep 21, 2023
@buffcode
Copy link
Contributor Author

CI failed to due to temporary Yarn failure:

An unexpected error occurred: "https://registry.yarnpkg.com/@octokit/rest/-/rest-18.12.0.tgz: Request failed \"502 Bad Gateway\"".

@orta
Copy link
Member

orta commented Sep 22, 2023

I think the key for the

esModuleInterop had to be enabled for DTS generation because...

Is that the CLI command which is being called needs the --esModuleInterop arg inline

@buffcode
Copy link
Contributor Author

Is that the CLI command which is being called needs the --esModuleInterop arg inline

Indeed, tsc won't use the tsconfig.json if the source file is specified directly... (microsoft/TypeScript#6591 (comment))

@buffcode buffcode marked this pull request as draft September 22, 2023 06:26
@buffcode buffcode marked this pull request as ready for review September 22, 2023 07:04
@orta
Copy link
Member

orta commented Sep 22, 2023

I'm not wild on:

Screenshot 2023-09-22 at 10 00 42

Because other danger runtimes, and the website use this schema to generate their DSLs/docs (which is why they were hand written before this PR) but all in all, I don't see enough activity in those spaces to really warrant keeping this restriction in place

Deploying this also might cause complications on the website which I'm probably not going to have any time to think about systemically for a long time so I guess we'll see how that goes too

@orta orta merged commit a80719a into danger:main Sep 22, 2023
1 check passed
@buffcode buffcode deleted the gitbeaker-v35 branch September 22, 2023 17:37
@glensc
Copy link
Contributor

glensc commented Oct 16, 2023

breaking changes. should have written so in the changelog.

#19 3.627 src/rules/assignee.ts:26:66 - error TS2322: Type 'unknown' is not assignable to type 'number | undefined'.
#19 3.627 
#19 3.627 26     await gitlab.api.MergeRequests.edit(mr.project_id, mr.iid, { assigneeId: mr.author.id });


#19 3.628 src/utils/is_renovatebot.ts:1:27 - error TS2724: '"danger"' has no exported member named 'GitLabUser'. Did you mean 'GitHubUser'?
#19 3.628 
#19 3.628 1 import { GitCommitAuthor, GitLabUser } from "danger";
#19 3.628                             ~~~~~~~~~~

@glensc
Copy link
Contributor

glensc commented Nov 20, 2023

My fixes:

-    await gitlab.api.MergeRequests.edit(mr.project_id, mr.iid, { assigneeId: mr.author.id });
+    const assigneeId = Number(mr.author.id);
+    await gitlab.api.MergeRequests.edit(mr.project_id, mr.iid, { assigneeId });

And

-import { GitCommitAuthor, GitLabUser } from "danger";
+import { GitCommitAuthor } from "danger";
+import { Types as CoreTypes } from "@gitbeaker/core";
+
+type GitLabUser = Omit<CoreTypes.UserSchema, "created_at">;

maybe danger.js should export such GitLabUser for downstream projects to use?

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.

4 participants