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

comment adds new comment with every commit #145

Open
maxkarkowski opened this issue Nov 27, 2023 · 63 comments · Fixed by #153, #154, #156 or #157
Open

comment adds new comment with every commit #145

maxkarkowski opened this issue Nov 27, 2023 · 63 comments · Fixed by #153, #154, #156 or #157

Comments

@maxkarkowski
Copy link

since we updated changesets-gitlab we have now the issue that with every commit the changesets-gitlab comment command creates a new comment in our merge request. before the update it only created one comment for a merge request.

@JounQin
Copy link
Member

JounQin commented Nov 27, 2023

Any screenshot?

Should be related to #138 or #143(most likely)

cc @alan910127

@alan910127
Copy link
Contributor

Hello @maxkarkowski, are you upgraded from v0.11.0 or v0.10.x?
This information can help me locate the issue faster 😄

@maxkarkowski
Copy link
Author

maxkarkowski commented Nov 28, 2023

hey @alan910127 sorry of course i can. we are currently on version 0.10.3

Update:
update to latest version and the problem is still there

@maxkarkowski
Copy link
Author

Any screenshot?

Should be related to #138 or #143(most likely)

cc @alan910127

here is a screenshot
screen

@maxkarkowski
Copy link
Author

but even if there is a changeset found, new comment will appear with everey command run
SCR-20231128-idwj

@alan910127
Copy link
Contributor

Hey @maxkarkowski, I couldn't reproduce the error on a project created on gitlab.com. Could you provide some information that might be related to this issue?

Here's something I think might be relevant:

@idumancic
Copy link

@alan910127 I have the same problem, we are using a self-hosted instance of GitLab if that helps, but when I tested on gitlab.com I also did not get any error.

@maxkarkowski
Copy link
Author

@alan910127 I have the same problem, we are using a self-hosted instance of GitLab if that helps, but when I tested on gitlab.com I also did not get any error.

we are also using a self hosted gitlab

@maxkarkowski
Copy link
Author

Hey @maxkarkowski, I couldn't reproduce the error on a project created on gitlab.com. Could you provide some information that might be related to this issue?

Here's something I think might be relevant:

this is the comment job we have . it runs on every merge request

comment:
  rules:
    - if: '$CI_MERGE_REQUEST_IID && $CI_COMMIT_BRANCH != "changeset-release/main"'
  extends:
    - .init-pnpm
  script:
    - pnpm changesets-gitlab comment # comment automatically like https://github.com/changesets/bot
    
.init-pnpm:
  before_script:
    - corepack enable
    - corepack prepare [email protected] --activate
    - node --max-old-space-size=8192
    - pnpm config set store-dir .pnpm-store
    - pnpm install # install dependencies
  cache:
    key:
      files:
        - pnpm-lock.yaml
    paths:
      - .pnpm-store

@alan910127
Copy link
Contributor

Got it. I will try to spin up a self-hosted GitLab instance and test the issue inside that.
What's your GitLab version in case it helps?

@maxkarkowski
Copy link
Author

Got it. I will try to spin up a self-hosted GitLab instance and test the issue inside that. What's your GitLab version in case it helps?

ist GitLab Community Edition v16.6.0

@JounQin
Copy link
Member

JounQin commented Dec 4, 2023

I may have opportunity to test and debug this issue on our internal GitLab service today, I'll try to give a fix soon.


I'm meeting bigger issues...:

image

@alan910127
Copy link
Contributor

alan910127 commented Dec 4, 2023

@JounQin I have found that the /projects/:id/merge_requests/:merge_request_iid/diffs is only available on GitLab 15.7 or above.
However, it's not documented very well though 😕, there is only a mention at the docs for changes API.

image

Reverting #143 could solve the 404 issue and potentially this issue as well.


Update:

Using [email protected] in a GitLab 13 instance does not have the issue of commenting repeatedly.
So, reverting #143 should also solve this one, but there will always be a deprecation warning in the pipeline though 😅.

JounQin added a commit that referenced this issue Dec 4, 2023
close #145

---------

Co-authored-by: JounQin <[email protected]>
@alan910127
Copy link
Contributor

@maxkarkowski @idumancic It should be fixed in version 0.11.4, you can try it out!

Untitled

@maxkarkowski
Copy link
Author

maxkarkowski commented Dec 5, 2023

@maxkarkowski @idumancic It should be fixed in version 0.11.4, you can try it out!

Untitled

didnt fix it for me :/

@JounQin
Copy link
Member

JounQin commented Dec 5, 2023

@maxkarkowski Please provide more details, such as GitLab instance version?

@JounQin JounQin reopened this Dec 5, 2023
@maxkarkowski
Copy link
Author

@maxkarkowski Please provide more details, such as GitLab instance version?

it is still GitLab Community Edition v16.6.0. ;) i just updated to the newest version of changesets-gitlab. the pipeline then executes pnpm changesets-gitlab comment .
i first commited without a changeset. then i added a changeset and commit this as well. and now i have still 2 comments in my merge request

@alan910127
Copy link
Contributor

alan910127 commented Dec 6, 2023

I'm a bit hesitant to admit this, but I'm having difficulty configuring a GitLab CE instance in a newer version with runners correctly. Would anyone be willing to grant me access to their GitLab instance so that I can test for the issue?

@maxkarkowski
Copy link
Author

I'm a bit hesitant to admit this, but I'm having difficulty configuring a GitLab CE instance in a newer version with runners correctly. Would anyone be willing to grant me access to their GitLab instance so that I can test for the issue?

sorry for the inconvenience but i cannot share my gitlab instance because it is owned by customer with very sensitive data

@idumancic
Copy link

@alan910127 Just wanted to tell you that it's fixed for me, it only generates one comment. Sorry for being so late to respond, honestly I forgot about it.

@maxkarkowski
Copy link
Author

@alan910127 Just wanted to tell you that it's fixed for me, it only generates one comment. Sorry for being so late to respond, honestly I forgot about it.

that is weird. can you maybe share what command you execute in your pipeline? i still get multiple comments :/

@JounQin
Copy link
Member

JounQin commented Dec 15, 2023

@maxkarkowski Maybe you can help to use patch-package to add some logs for debugging? I don't have a GitLab CE v16.6.0 for debugging for you, sorry.

@maxkarkowski
Copy link
Author

maxkarkowski commented Dec 18, 2023

@maxkarkowski Maybe you can help to use patch-package to add some logs for debugging? I don't have a GitLab CE v16.6.0 for debugging for you, sorry.

what exactly should i do with patch package? run it before changesets-gitlab on my pipeline? i use pnpm so i can only use pnpm patch.

@JounQin
Copy link
Member

JounQin commented Dec 18, 2023

what exactly should i do with patch package? run it before changesets-gitlab on my pipeline? i use pnpm so i can only use pnpm patch.

Thanks that you're willing to help for debugging.

You can try to patch node_modules/changesets-gitlab/lib/comment.js accordingly.

Mostly you should add some logs at the following:

const getNoteInfo = (api: Gitlab, mrIid: number | string) =>
api.MergeRequestDiscussions.all(context.projectId, mrIid).then(
async discussions => {
for (const discussion of discussions) {
if (!discussion.notes) {
continue
}
const username = await getUsername(api)
const changesetBotNote = discussion.notes.find(
note =>
note.author.username === username &&
// We need to ensure the note is generated by us, but we don't have an app bot like GitHub
// @see https://github.com/apps/changeset-bot
note.body.includes(generatedByBotNote),
)
if (changesetBotNote) {
return {
discussionId: discussion.id,
noteId: changesetBotNote.id,
}
}
}
},
)

So that we can check why the previous mr was not found.


After seeing api.MergeRequestDiscussions, I have a theory that it could be API changed between MR discussions vs notes.

JounQin added a commit that referenced this issue Dec 18, 2023
@JounQin
Copy link
Member

JounQin commented Dec 18, 2023

# yarn 1
yarn add https://pkg.csb.dev/un-ts/changesets-gitlab/commit/4c11e8af/changesets-gitlab
# yarn 2, 3
yarn add changesets-gitlab@https://pkg.csb.dev/un-ts/changesets-gitlab/commit/4c11e8af/changesets-gitlab/_pkg.tgz
# npm
npm i https://pkg.csb.dev/un-ts/changesets-gitlab/commit/4c11e8af/changesets-gitlab

@maxkarkowski Please help to test the new version. And you may need to change group_114_bot2 to group_114_bot instead. Or just remove that environment.

@alan910127 If you're free, please help to review #156.

@alan910127
Copy link
Contributor

@alan910127 If you're free, please help to review #156.

Seems like I'm too late, sorry about that 😅.

@JounQin
Copy link
Member

JounQin commented Dec 19, 2023

@alan910127 Never mind. You can still help to review it to prevent unexpected regressions or bugs.

@maxkarkowski
Copy link
Author

i am sorry to say it but i installed the newest version and still get multiple comments

@JounQin
Copy link
Member

JounQin commented Dec 19, 2023

@maxkarkowski 🤣 Let's debug again.

@maxkarkowski
Copy link
Author

@maxkarkowski 🤣 Let's debug again.

what can i do?

@JounQin JounQin reopened this Dec 19, 2023
@JounQin
Copy link
Member

JounQin commented Dec 19, 2023

@maxkarkowski As previous, add log at

const isChangesetBotNote = (
note: DiscussionNoteSchema | NoteSchema,
username: string,
random?: boolean,
) =>
(note.author.username === username ||
(random &&
note.author.username.match(RANDOM_BOT_NAME_PATTERN)?.[1] === username)) &&
// We need to ensure the note is generated by us, but we don't have an app bot like GitHub
// @see https://github.com/apps/changeset-bot
note.body.includes(generatedByBotNote)
to check why the previous comment unrecognized.

@maxkarkowski
Copy link
Author

@maxkarkowski As previous, add log at

const isChangesetBotNote = (
note: DiscussionNoteSchema | NoteSchema,
username: string,
random?: boolean,
) =>
(note.author.username === username ||
(random &&
note.author.username.match(RANDOM_BOT_NAME_PATTERN)?.[1] === username)) &&
// We need to ensure the note is generated by us, but we don't have an app bot like GitHub
// @see https://github.com/apps/changeset-bot
note.body.includes(generatedByBotNote)

to check why the previous comment unrecognized.

if i use pnpm patch i pnly have the compiled js file. i'll try to add some console.logs

@maxkarkowski
Copy link
Author

maxkarkowski commented Dec 19, 2023

function isChangesetBotNote(note, username, random) {
  console.log("note", note);
  console.log("username", username);
  console.log("random", random);
  if (
    note.author.username === username ||
    (random &&
      note.author.username.match(RANDOM_BOT_NAME_PATTERN)?.[1] === username)
  ) {
    console.log(generatedByBotNote);
    console.log(username);
    note.body.includes(generatedByBotNote);
  } else {
    console.log("else block;");
  }
}

i added some console.logs like this. and the result is

note {
  id: 495260,
  type: 'DiscussionNote',
  body: '###  ⚠️  No Changeset found\n' +
    '\n' +
    'Latest commit: \n' +
    '\n' +
    "Merging this MR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. **If these changes should result in a version bump, you need to add a changeset.**\n" +
    '\n' +
    '<details><summary>This MR includes no changesets</summary>\n' +
    '\n' +
    "  When changesets are added to this MR, you'll see the packages that this MR includes changesets for and the associated semver types\n" +
    '\n' +
    '</details>\n' +
    '\n' +
    '[Click here to learn what changesets are, and how to add one](https://github.com/changesets/changesets/blob/master/docs/adding-a-changeset.md).\n' +
    '\n' +
    "[Click here if you're a maintainer who wants to add a changeset to this MR](https://REDACTEDURL/REDACTEDREPOPATH/-/new/test/changesets-gitlab-new-version?file_name=.changeset/evil-lizards-doubt.md&file=---%0A%0A---%0A%0Afeat%3A%20update%20changesets-gitlab%0A)\n" +
    '\n' +
    '__Generated By Changesets GitLab Bot__',
  attachment: null,
  author: {
    id: 768,
    username: 'group_114_bot_HASH',
    name: '****',
    state: 'active',
    locked: false,
    avatar_url: 'GRAVATARURL',
    web_url: 'https://REDACTEDURL/group_114_bot_HASH'
  },
  created_at: '2023-12-19T10:43:51.351Z',
  updated_at: '2023-12-19T10:43:51.351Z',
  system: false,
  noteable_id: 52608,
  noteable_type: 'MergeRequest',
  project_id: 3136,
  resolvable: true,
  resolved: false,
  resolved_by: null,
  resolved_at: null,
  confidential: false,
  internal: false,
  noteable_iid: 482,
  commands_changes: {}
}
username group_114_bot2
random undefined
else block;
note {
  id: 495262,
  type: null,
  body: 'marked this merge request as **draft**',
  attachment: null,
  author: {
    id: 99,
    username: 'max.karkowski',
    name: 'Karkowski, Max',
    state: 'active',
    locked: false,
    avatar_url: 'https://secure.gravatar.com/avatar/ce5c37b052e79f9fa048081386068c91?s=80&d=identicon',
    web_url: 'https://REDACTEDURL/max.karkowski'
  },
  created_at: '2023-12-19T10:44:35.198Z',
  updated_at: '2023-12-19T10:44:35.203Z',
  system: true,
  noteable_id: 52608,
  noteable_type: 'MergeRequest',
  project_id: 3136,
  resolvable: false,
  confidential: false,
  internal: false,
  noteable_iid: 482,
  commands_changes: {}
}
username group_114_bot2
random undefined
else block;
note {
  id: 495272,
  type: null,
  body: 'added 1 commit\n' +
    '\n' +
    '<ul><li>93b5cbba - feat: add changeset</li></ul>\n' +
    '\n' +
    '[Compare with previous version](/REDACTEDREPOPATH/-/merge_requests/482/diffs?diff_id=291444&start_sha=aa97a9058a48bbe321f66b111dc726111a426a89)',
  attachment: null,
  author: {
    id: 99,
    username: 'max.karkowski',
    name: 'Karkowski, Max',
    state: 'active',
    locked: false,
    avatar_url: 'https://secure.gravatar.com/avatar/ce5c37b052e79f9fa048081386068c91?s=80&d=identicon',
    web_url: 'https://REDACTEDURL/max.karkowski'
  },
  created_at: '2023-12-19T10:50:42.500Z',
  updated_at: '2023-12-19T10:50:42.513Z',
  system: true,
  noteable_id: 52608,
  noteable_type: 'MergeRequest',
  project_id: 3136,
  resolvable: false,
  confidential: false,
  internal: false,
  noteable_iid: 482,
  commands_changes: {}
}
username group_114_bot2
random undefined
else block;
note {
  id: 495273,
  type: 'DiscussionNote',
  body: '###  🦋  Changeset detected\n' +
    '\n' +
    'Latest commit: \n' +
    '\n' +
    '**The changes in this MR will be included in the next version bump.**\n' +
    '\n' +
    '<details><summary>This MR includes changesets to release 1 package</summary>\n' +
    '\n' +
    '  | Name         | Type  |\n' +
    '| ------------ | ----- |\n' +
    '| custom-theme | Patch |\n' +
    '\n' +
    '</details>\n' +
    '\n' +
    'Not sure what this means? [Click here  to learn what changesets are](https://github.com/changesets/changesets/blob/master/docs/adding-a-changeset.md).\n' +
    '\n' +
    "[Click here if you're a maintainer who wants to add another changeset to this MR](https://REDACTEDURL/REDACTEDREPOPATH/-/new/test/changesets-gitlab-new-version?file_name=.changeset/bumpy-trains-tap.md&file=---%0A%0A---%0A%0ADraft%3A%20feat%3A%20update%20changesets-gitlab%0A)\n" +
    '\n' +
    '__Generated By Changesets GitLab Bot__',
  attachment: null,
  author: {
    id: 768,
    username: 'group_114_bot_HASH',
    name: '****',
    state: 'active',
    locked: false,
    avatar_url: 'GRAVATARURL',
    web_url: 'https://REDACTEDURL/group_114_bot_HASH'
  },
  created_at: '2023-12-19T10:51:30.037Z',
  updated_at: '2023-12-19T10:51:30.037Z',
  system: false,
  noteable_id: 52608,
  noteable_type: 'MergeRequest',
  project_id: 3136,
  resolvable: true,
  resolved: false,
  resolved_by: null,
  resolved_at: null,
  confidential: false,
  internal: false,
  noteable_iid: 482,
  commands_changes: {}
}
username group_114_bot2
random undefined
else block;
note {
  id: 495280,
  type: null,
  body: 'added 1 commit\n' +
    '\n' +
    '<ul><li>e4876a45 - test: debug username</li></ul>\n' +
    '\n' +
    '[Compare with previous version](/REDACTEDREPOPATH/-/merge_requests/482/diffs?diff_id=291450&start_sha=93b5cbba2e3f7129e991640caa0c028d630f83dd)',
  attachment: null,
  author: {
    id: 99,
    username: 'max.karkowski',
    name: 'Karkowski, Max',
    state: 'active',
    locked: false,
    avatar_url: 'https://secure.gravatar.com/avatar/ce5c37b052e79f9fa048081386068c91?s=80&d=identicon',
    web_url: 'https://REDACTEDURL/max.karkowski'
  },
  created_at: '2023-12-19T10:56:54.710Z',
  updated_at: '2023-12-19T10:56:54.714Z',
  system: true,
  noteable_id: 52608,
  noteable_type: 'MergeRequest',
  project_id: 3136,
  resolvable: false,
  confidential: false,
  internal: false,
  noteable_iid: 482,
  commands_changes: {}
}
username group_114_bot2
random undefined
else block;
note {
  id: 495281,
  type: 'DiscussionNote',
  body: '###  🦋  Changeset detected\n' +
    '\n' +
    'Latest commit: \n' +
    '\n' +
    '**The changes in this MR will be included in the next version bump.**\n' +
    '\n' +
    '<details><summary>This MR includes changesets to release 1 package</summary>\n' +
    '\n' +
    '  | Name         | Type  |\n' +
    '| ------------ | ----- |\n' +
    '| custom-theme | Patch |\n' +
    '\n' +
    '</details>\n' +
    '\n' +
    'Not sure what this means? [Click here  to learn what changesets are](https://github.com/changesets/changesets/blob/master/docs/adding-a-changeset.md).\n' +
    '\n' +
    "[Click here if you're a maintainer who wants to add another changeset to this MR](https://REDACTEDURL/REDACTEDREPOPATH/-/new/test/changesets-gitlab-new-version?file_name=.changeset/sixty-teams-warn.md&file=---%0A%0A---%0A%0ADraft%3A%20feat%3A%20update%20changesets-gitlab%0A)\n" +
    '\n' +
    '__Generated By Changesets GitLab Bot__',
  attachment: null,
  author: {
    id: 768,
    username: 'group_114_bot_HASH',
    name: '****',
    state: 'active',
    locked: false,
    avatar_url: 'GRAVATARURL',
    web_url: 'https://REDACTEDURL/group_114_bot_HASH'
  },
  created_at: '2023-12-19T10:57:54.212Z',
  updated_at: '2023-12-19T10:57:54.212Z',
  system: false,
  noteable_id: 52608,
  noteable_type: 'MergeRequest',
  project_id: 3136,
  resolvable: true,
  resolved: false,
  resolved_by: null,
  resolved_at: null,
  confidential: false,
  internal: false,
  noteable_iid: 482,
  commands_changes: {}
}
username group_114_bot2
random undefined
else block;
note {
  id: 495283,
  type: null,
  body: 'added 1 commit\n' +
    '\n' +
    '<ul><li>f2dc6603 - feat: debug even more</li></ul>\n' +
    '\n' +
    '[Compare with previous version](/REDACTEDREPOPATH/-/merge_requests/482/diffs?diff_id=291452&start_sha=e4876a4562f02af2f7e81aee6643bb744debeb23)',
  attachment: null,
  author: {
    id: 99,
    username: 'max.karkowski',
    name: 'Karkowski, Max',
    state: 'active',
    locked: false,
    avatar_url: 'https://secure.gravatar.com/avatar/ce5c37b052e79f9fa048081386068c91?s=80&d=identicon',
    web_url: 'https://REDACTEDURL/max.karkowski'
  },
  created_at: '2023-12-19T10:59:36.752Z',
  updated_at: '2023-12-19T10:59:36.757Z',
  system: true,
  noteable_id: 52608,
  noteable_type: 'MergeRequest',
  project_id: 3136,
  resolvable: false,
  confidential: false,
  internal: false,
  noteable_iid: 482,
  commands_changes: {}
}
username group_114_bot2
random undefined
else block;
note {
  id: 495285,
  type: null,
  body: 'added 1 commit\n' +
    '\n' +
    '<ul><li>443c7a4c - test: debug</li></ul>\n' +
    '\n' +
    '[Compare with previous version](/REDACTEDREPOPATH/-/merge_requests/482/diffs?diff_id=291458&start_sha=f2dc66035c4930cfa2c048cb3a09464f5f4eccc2)',
  attachment: null,
  author: {
    id: 99,
    username: 'max.karkowski',
    name: 'Karkowski, Max',
    state: 'active',
    locked: false,
    avatar_url: 'https://secure.gravatar.com/avatar/ce5c37b052e79f9fa048081386068c91?s=80&d=identicon',
    web_url: 'https://REDACTEDURL/max.karkowski'
  },
  created_at: '2023-12-19T11:05:31.451Z',
  updated_at: '2023-12-19T11:05:31.454Z',
  system: true,
  noteable_id: 52608,
  noteable_type: 'MergeRequest',
  project_id: 3136,
  resolvable: false,
  confidential: false,
  internal: false,
  noteable_iid: 482,
  commands_changes: {}
}
username group_114_bot2
random undefined
else block;
note {
  id: 495260,
  type: 'DiscussionNote',
  body: '###  ⚠️  No Changeset found\n' +
    '\n' +
    'Latest commit: \n' +
    '\n' +
    "Merging this MR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. **If these changes should result in a version bump, you need to add a changeset.**\n" +
    '\n' +
    '<details><summary>This MR includes no changesets</summary>\n' +
    '\n' +
    "  When changesets are added to this MR, you'll see the packages that this MR includes changesets for and the associated semver types\n" +
    '\n' +
    '</details>\n' +
    '\n' +
    '[Click here to learn what changesets are, and how to add one](https://github.com/changesets/changesets/blob/master/docs/adding-a-changeset.md).\n' +
    '\n' +
    "[Click here if you're a maintainer who wants to add a changeset to this MR](https://REDACTEDURL/REDACTEDREPOPATH/-/new/test/changesets-gitlab-new-version?file_name=.changeset/evil-lizards-doubt.md&file=---%0A%0A---%0A%0Afeat%3A%20update%20changesets-gitlab%0A)\n" +
    '\n' +
    '__Generated By Changesets GitLab Bot__',
  attachment: null,
  author: {
    id: 768,
    username: 'group_114_bot_HASH',
    name: '****',
    state: 'active',
    locked: false,
    avatar_url: 'GRAVATARURL',
    web_url: 'https://REDACTEDURL/group_114_bot_HASH'
  },
  created_at: '2023-12-19T10:43:51.351Z',
  updated_at: '2023-12-19T10:43:51.351Z',
  system: false,
  noteable_id: 52608,
  noteable_type: 'MergeRequest',
  project_id: 3136,
  resolvable: true,
  resolved: false,
  resolved_by: null,
  resolved_at: null,
  confidential: false,
  internal: false,
  noteable_iid: 482,
  commands_changes: {}
}
username group_114_bot2
random undefined
else block;
note {
  id: 495262,
  type: null,
  body: 'marked this merge request as **draft**',
  attachment: null,
  author: {
    id: 99,
    username: 'max.karkowski',
    name: 'Karkowski, Max',
    state: 'active',
    locked: false,
    avatar_url: 'https://secure.gravatar.com/avatar/ce5c37b052e79f9fa048081386068c91?s=80&d=identicon',
    web_url: 'https://REDACTEDURL/max.karkowski'
  },
  created_at: '2023-12-19T10:44:35.198Z',
  updated_at: '2023-12-19T10:44:35.203Z',
  system: true,
  noteable_id: 52608,
  noteable_type: 'MergeRequest',
  project_id: 3136,
  resolvable: false,
  confidential: false,
  internal: false,
  noteable_iid: 482,
  commands_changes: {}
}
username group_114_bot2
random undefined
else block;
note {
  id: 495272,
  type: null,
  body: 'added 1 commit\n' +
    '\n' +
    '<ul><li>93b5cbba - feat: add changeset</li></ul>\n' +
    '\n' +
    '[Compare with previous version](/REDACTEDREPOPATH/-/merge_requests/482/diffs?diff_id=291444&start_sha=aa97a9058a48bbe321f66b111dc726111a426a89)',
  attachment: null,
  author: {
    id: 99,
    username: 'max.karkowski',
    name: 'Karkowski, Max',
    state: 'active',
    locked: false,
    avatar_url: 'https://secure.gravatar.com/avatar/ce5c37b052e79f9fa048081386068c91?s=80&d=identicon',
    web_url: 'https://REDACTEDURL/max.karkowski'
  },
  created_at: '2023-12-19T10:50:42.500Z',
  updated_at: '2023-12-19T10:50:42.513Z',
  system: true,
  noteable_id: 52608,
  noteable_type: 'MergeRequest',
  project_id: 3136,
  resolvable: false,
  confidential: false,
  internal: false,
  noteable_iid: 482,
  commands_changes: {}
}
username group_114_bot2
random undefined
else block;
note {
  id: 495273,
  type: 'DiscussionNote',
  body: '###  🦋  Changeset detected\n' +
    '\n' +
    'Latest commit: \n' +
    '\n' +
    '**The changes in this MR will be included in the next version bump.**\n' +
    '\n' +
    '<details><summary>This MR includes changesets to release 1 package</summary>\n' +
    '\n' +
    '  | Name         | Type  |\n' +
    '| ------------ | ----- |\n' +
    '| custom-theme | Patch |\n' +
    '\n' +
    '</details>\n' +
    '\n' +
    'Not sure what this means? [Click here  to learn what changesets are](https://github.com/changesets/changesets/blob/master/docs/adding-a-changeset.md).\n' +
    '\n' +
    "[Click here if you're a maintainer who wants to add another changeset to this MR](https://REDACTEDURL/REDACTEDREPOPATH/-/new/test/changesets-gitlab-new-version?file_name=.changeset/bumpy-trains-tap.md&file=---%0A%0A---%0A%0ADraft%3A%20feat%3A%20update%20changesets-gitlab%0A)\n" +
    '\n' +
    '__Generated By Changesets GitLab Bot__',
  attachment: null,
  author: {
    id: 768,
    username: 'group_114_bot_HASH',
    name: '****',
    state: 'active',
    locked: false,
    avatar_url: 'GRAVATARURL',
    web_url: 'https://REDACTEDURL/group_114_bot_HASH'
  },
  created_at: '2023-12-19T10:51:30.037Z',
  updated_at: '2023-12-19T10:51:30.037Z',
  system: false,
  noteable_id: 52608,
  noteable_type: 'MergeRequest',
  project_id: 3136,
  resolvable: true,
  resolved: false,
  resolved_by: null,
  resolved_at: null,
  confidential: false,
  internal: false,
  noteable_iid: 482,
  commands_changes: {}
}
username group_114_bot2
random undefined
else block;
note {
  id: 495280,
  type: null,
  body: 'added 1 commit\n' +
    '\n' +
    '<ul><li>e4876a45 - test: debug username</li></ul>\n' +
    '\n' +
    '[Compare with previous version](/REDACTEDREPOPATH/-/merge_requests/482/diffs?diff_id=291450&start_sha=93b5cbba2e3f7129e991640caa0c028d630f83dd)',
  attachment: null,
  author: {
    id: 99,
    username: 'max.karkowski',
    name: 'Karkowski, Max',
    state: 'active',
    locked: false,
    avatar_url: 'https://secure.gravatar.com/avatar/ce5c37b052e79f9fa048081386068c91?s=80&d=identicon',
    web_url: 'https://REDACTEDURL/max.karkowski'
  },
  created_at: '2023-12-19T10:56:54.710Z',
  updated_at: '2023-12-19T10:56:54.714Z',
  system: true,
  noteable_id: 52608,
  noteable_type: 'MergeRequest',
  project_id: 3136,
  resolvable: false,
  confidential: false,
  internal: false,
  noteable_iid: 482,
  commands_changes: {}
}
username group_114_bot2
random undefined
else block;
note {
  id: 495281,
  type: 'DiscussionNote',
  body: '###  🦋  Changeset detected\n' +
    '\n' +
    'Latest commit: \n' +
    '\n' +
    '**The changes in this MR will be included in the next version bump.**\n' +
    '\n' +
    '<details><summary>This MR includes changesets to release 1 package</summary>\n' +
    '\n' +
    '  | Name         | Type  |\n' +
    '| ------------ | ----- |\n' +
    '| custom-theme | Patch |\n' +
    '\n' +
    '</details>\n' +
    '\n' +
    'Not sure what this means? [Click here  to learn what changesets are](https://github.com/changesets/changesets/blob/master/docs/adding-a-changeset.md).\n' +
    '\n' +
    "[Click here if you're a maintainer who wants to add another changeset to this MR](https://REDACTEDURL/REDACTEDREPOPATH/-/new/test/changesets-gitlab-new-version?file_name=.changeset/sixty-teams-warn.md&file=---%0A%0A---%0A%0ADraft%3A%20feat%3A%20update%20changesets-gitlab%0A)\n" +
    '\n' +
    '__Generated By Changesets GitLab Bot__',
  attachment: null,
  author: {
    id: 768,
    username: 'group_114_bot_HASH',
    name: '****',
    state: 'active',
    locked: false,
    avatar_url: 'GRAVATARURL',
    web_url: 'https://REDACTEDURL/group_114_bot_HASH'
  },
  created_at: '2023-12-19T10:57:54.212Z',
  updated_at: '2023-12-19T10:57:54.212Z',
  system: false,
  noteable_id: 52608,
  noteable_type: 'MergeRequest',
  project_id: 3136,
  resolvable: true,
  resolved: false,
  resolved_by: null,
  resolved_at: null,
  confidential: false,
  internal: false,
  noteable_iid: 482,
  commands_changes: {}
}
username group_114_bot2
random undefined
else block;
note {
  id: 495283,
  type: null,
  body: 'added 1 commit\n' +
    '\n' +
    '<ul><li>f2dc6603 - feat: debug even more</li></ul>\n' +
    '\n' +
    '[Compare with previous version](/REDACTEDREPOPATH/-/merge_requests/482/diffs?diff_id=291452&start_sha=e4876a4562f02af2f7e81aee6643bb744debeb23)',
  attachment: null,
  author: {
    id: 99,
    username: 'max.karkowski',
    name: 'Karkowski, Max',
    state: 'active',
    locked: false,
    avatar_url: 'https://secure.gravatar.com/avatar/ce5c37b052e79f9fa048081386068c91?s=80&d=identicon',
    web_url: 'https://REDACTEDURL/max.karkowski'
  },
  created_at: '2023-12-19T10:59:36.752Z',
  updated_at: '2023-12-19T10:59:36.757Z',
  system: true,
  noteable_id: 52608,
  noteable_type: 'MergeRequest',
  project_id: 3136,
  resolvable: false,
  confidential: false,
  internal: false,
  noteable_iid: 482,
  commands_changes: {}
}
username group_114_bot2
random undefined
else block;
note {
  id: 495285,
  type: null,
  body: 'added 1 commit\n' +
    '\n' +
    '<ul><li>443c7a4c - test: debug</li></ul>\n' +
    '\n' +
    '[Compare with previous version](/REDACTEDREPOPATH/-/merge_requests/482/diffs?diff_id=291458&start_sha=f2dc66035c4930cfa2c048cb3a09464f5f4eccc2)',
  attachment: null,
  author: {
    id: 99,
    username: 'max.karkowski',
    name: 'Karkowski, Max',
    state: 'active',
    locked: false,
    avatar_url: 'https://secure.gravatar.com/avatar/ce5c37b052e79f9fa048081386068c91?s=80&d=identicon',
    web_url: 'https://REDACTEDURL/max.karkowski'
  },
  created_at: '2023-12-19T11:05:31.451Z',
  updated_at: '2023-12-19T11:05:31.454Z',
  system: true,
  noteable_id: 52608,
  noteable_type: 'MergeRequest',
  project_id: 3136,
  resolvable: false,
  confidential: false,
  internal: false,
  noteable_iid: 482,
  commands_changes: {}
}
username group_114_bot2
random undefined
else block;

@JounQin
Copy link
Member

JounQin commented Dec 19, 2023

group_114_bot_5c775e3447ee50f45b58355852330c78 vs group_114_bot2, I don't think we can handle it automatically, can you remove the env and try again?

@maxkarkowski
Copy link
Author

so without a gitlab_user_name?

@JounQin
Copy link
Member

JounQin commented Dec 19, 2023

yep

GITLAB_CI_USER_NAME # optional, username with accessibility to push, used in pairs of the above token (if it was personal access token). If not set read it from the Gitlab API

@maxkarkowski
Copy link
Author

i altered the name to GITLAB_CI_USER_NAME_BKP . still got a new comment

@maxkarkowski
Copy link
Author

maxkarkowski commented Dec 19, 2023

noteauthorusername max.karkowski
note.body marked this merge request as **draft**
username group_114_bot_HASH
random undefined
else block;
noteauthorusername max.karkowski
note.body added 1 commit
<ul><li>93b5cbba - feat: add changeset</li></ul>
[Compare with previous version](/REDDACTEDPATH-/merge_requests/482/diffs?diff_id=291444&start_sha=aa97a9058a48bbe321f66b111dc726111a426a89)
username group_114_bot_HASH
random undefined
else block;
noteauthorusername max.karkowski
note.body added 1 commit
<ul><li>e4876a45 - test: debug username</li></ul>
[Compare with previous version](/REDDACTEDPATH-/merge_requests/482/diffs?diff_id=291450&start_sha=93b5cbba2e3f7129e991640caa0c028d630f83dd)
username group_114_bot_HASH
random undefined
else block;
noteauthorusername max.karkowski
note.body added 1 commit
<ul><li>f2dc6603 - feat: debug even more</li></ul>
[Compare with previous version](/REDDACTEDPATH-/merge_requests/482/diffs?diff_id=291452&start_sha=e4876a4562f02af2f7e81aee6643bb744debeb23)
username group_114_bot_HASH
random undefined
else block;
noteauthorusername max.karkowski
note.body added 1 commit
<ul><li>443c7a4c - test: debug</li></ul>
[Compare with previous version](/REDDACTEDPATH-/merge_requests/482/diffs?diff_id=291458&start_sha=f2dc66035c4930cfa2c048cb3a09464f5f4eccc2)
username group_114_bot_HASH
random undefined
else block;
noteauthorusername max.karkowski
note.body added 1 commit
<ul><li>f245f74a - feat: alter changeset</li></ul>
[Compare with previous version](/REDDACTEDPATH-/merge_requests/482/diffs?diff_id=291461&start_sha=443c7a4c6152c61b43f91e0ca242d00cc304d2e8)
username group_114_bot_HASH
random undefined
else block;
noteauthorusername max.karkowski
note.body added 1 commit
<ul><li>9a6b30ca - feat: new console.logs</li></ul>
[Compare with previous version](/REDDACTEDPATH-/merge_requests/482/diffs?diff_id=291464&start_sha=f245f74a21ced2f2ed04c0921d1ccd5f47ae9347)
username group_114_bot_HASH
random undefined
else block;
noteauthorusername max.karkowski
note.body marked this merge request as **draft**
username group_114_bot_HASH
random undefined
else block;
noteauthorusername max.karkowski
note.body added 1 commit
<ul><li>93b5cbba - feat: add changeset</li></ul>
[Compare with previous version](/REDDACTEDPATH-/merge_requests/482/diffs?diff_id=291444&start_sha=aa97a9058a48bbe321f66b111dc726111a426a89)
username group_114_bot_HASH
random undefined
else block;
noteauthorusername max.karkowski
note.body added 1 commit
<ul><li>e4876a45 - test: debug username</li></ul>
[Compare with previous version](/REDDACTEDPATH-/merge_requests/482/diffs?diff_id=291450&start_sha=93b5cbba2e3f7129e991640caa0c028d630f83dd)
username group_114_bot_HASH
random undefined
else block;
noteauthorusername max.karkowski
note.body added 1 commit
<ul><li>f2dc6603 - feat: debug even more</li></ul>
[Compare with previous version](/REDDACTEDPATH-/merge_requests/482/diffs?diff_id=291452&start_sha=e4876a4562f02af2f7e81aee6643bb744debeb23)
username group_114_bot_HASH
random undefined
else block;
noteauthorusername max.karkowski
note.body added 1 commit
<ul><li>443c7a4c - test: debug</li></ul>
[Compare with previous version](/REDDACTEDPATH-/merge_requests/482/diffs?diff_id=291458&start_sha=f2dc66035c4930cfa2c048cb3a09464f5f4eccc2)
username group_114_bot_HASH
random undefined
else block;
noteauthorusername max.karkowski
note.body added 1 commit
<ul><li>f245f74a - feat: alter changeset</li></ul>
[Compare with previous version](/REDDACTEDPATH-/merge_requests/482/diffs?diff_id=291461&start_sha=443c7a4c6152c61b43f91e0ca242d00cc304d2e8)
username group_114_bot_HASH
random undefined
else block;
noteauthorusername max.karkowski
note.body added 1 commit
<ul><li>9a6b30ca - feat: new console.logs</li></ul>
[Compare with previous version](/REDDACTEDPATH-/merge_requests/482/diffs?diff_id=291464&start_sha=f245f74a21ced2f2ed04c0921d1ccd5f47ae9347)
username group_114_bot_HASH
random undefined
else block;

and the next commit

noteauthorusername max.karkowski
note.body marked this merge request as **draft**
username group_114_bot_HASH
random undefined
else block;
noteauthorusername max.karkowski
note.body added 1 commit
<ul><li>93b5cbba - feat: add changeset</li></ul>
[Compare with previous version](REDACTED-/merge_requests/482/diffs?diff_id=291444&start_sha=aa97a9058a48bbe321f66b111dc726111a426a89)
username group_114_bot_HASH
random undefined
else block;
noteauthorusername max.karkowski
note.body added 1 commit
<ul><li>e4876a45 - test: debug username</li></ul>
[Compare with previous version](REDACTED-/merge_requests/482/diffs?diff_id=291450&start_sha=93b5cbba2e3f7129e991640caa0c028d630f83dd)
username group_114_bot_HASH
random undefined
else block;
noteauthorusername max.karkowski
note.body added 1 commit
<ul><li>f2dc6603 - feat: debug even more</li></ul>
[Compare with previous version](REDACTED-/merge_requests/482/diffs?diff_id=291452&start_sha=e4876a4562f02af2f7e81aee6643bb744debeb23)
username group_114_bot_HASH
random undefined
else block;
noteauthorusername max.karkowski
note.body added 1 commit
<ul><li>443c7a4c - test: debug</li></ul>
[Compare with previous version](REDACTED-/merge_requests/482/diffs?diff_id=291458&start_sha=f2dc66035c4930cfa2c048cb3a09464f5f4eccc2)
username group_114_bot_HASH
random undefined
else block;
noteauthorusername max.karkowski
note.body added 1 commit
<ul><li>f245f74a - feat: alter changeset</li></ul>
[Compare with previous version](REDACTED-/merge_requests/482/diffs?diff_id=291461&start_sha=443c7a4c6152c61b43f91e0ca242d00cc304d2e8)
username group_114_bot_HASH
random undefined
else block;
noteauthorusername max.karkowski
note.body added 1 commit
<ul><li>9a6b30ca - feat: new console.logs</li></ul>
[Compare with previous version](REDACTED-/merge_requests/482/diffs?diff_id=291464&start_sha=f245f74a21ced2f2ed04c0921d1ccd5f47ae9347)
username group_114_bot_HASH
random undefined
else block;
noteauthorusername group_114_bot_HASH
note.body ###  🦋  Changeset detected
Latest commit: 
**The changes in this MR will be included in the next version bump.**
<details><summary>This MR includes changesets to release 1 package</summary>
  | Name         | Type  |
| ------------ | ----- |
| custom-theme | Patch |
</details>
Not sure what this means? [Click here  to learn what changesets are](https://github.com/changesets/changesets/blob/master/docs/adding-a-changeset.md).
[Click here if you're a maintainer who wants to add another changeset to this MR](https://REDACTEDREDACTED-/new/test/changesets-gitlab-new-version?file_name=.changeset/lucky-memes-invent.md&file=---%0A%0A---%0A%0ADraft%3A%20feat%3A%20update%20changesets-gitlab%0A)
__Generated By Changesets GitLab Bot__
username group_114_bot_HASH
random undefined
Generated By Changesets GitLab Bot
group_114_bot_HASH
noteauthorusername max.karkowski
note.body added 1 commit
<ul><li>cc894f9d - feat: add another word</li></ul>
[Compare with previous version](REDACTED-/merge_requests/482/diffs?diff_id=291466&start_sha=9a6b30ca65b0803684ddc68f9ca4d793de4b5a6a)
username group_114_bot_HASH
random undefined
else block;
noteauthorusername max.karkowski
note.body marked this merge request as **draft**
username group_114_bot_HASH
random undefined
else block;
noteauthorusername max.karkowski
note.body added 1 commit
<ul><li>93b5cbba - feat: add changeset</li></ul>
[Compare with previous version](REDACTED-/merge_requests/482/diffs?diff_id=291444&start_sha=aa97a9058a48bbe321f66b111dc726111a426a89)
username group_114_bot_HASH
random undefined
else block;
noteauthorusername max.karkowski
note.body added 1 commit
<ul><li>e4876a45 - test: debug username</li></ul>
[Compare with previous version](REDACTED-/merge_requests/482/diffs?diff_id=291450&start_sha=93b5cbba2e3f7129e991640caa0c028d630f83dd)
username group_114_bot_HASH
random undefined
else block;
noteauthorusername max.karkowski
note.body added 1 commit
<ul><li>f2dc6603 - feat: debug even more</li></ul>
[Compare with previous version](REDACTED-/merge_requests/482/diffs?diff_id=291452&start_sha=e4876a4562f02af2f7e81aee6643bb744debeb23)
username group_114_bot_HASH
random undefined
else block;
noteauthorusername max.karkowski
note.body added 1 commit
<ul><li>443c7a4c - test: debug</li></ul>
[Compare with previous version](REDACTED-/merge_requests/482/diffs?diff_id=291458&start_sha=f2dc66035c4930cfa2c048cb3a09464f5f4eccc2)
username group_114_bot_HASH
random undefined
else block;
noteauthorusername max.karkowski
note.body added 1 commit
<ul><li>f245f74a - feat: alter changeset</li></ul>
[Compare with previous version](REDACTED-/merge_requests/482/diffs?diff_id=291461&start_sha=443c7a4c6152c61b43f91e0ca242d00cc304d2e8)
username group_114_bot_HASH
random undefined
else block;
noteauthorusername max.karkowski
note.body added 1 commit
<ul><li>9a6b30ca - feat: new console.logs</li></ul>
[Compare with previous version](REDACTED-/merge_requests/482/diffs?diff_id=291464&start_sha=f245f74a21ced2f2ed04c0921d1ccd5f47ae9347)
username group_114_bot_HASH
random undefined
else block;
noteauthorusername group_114_bot_HASH
note.body ###  🦋  Changeset detected
Latest commit: 
**The changes in this MR will be included in the next version bump.**
<details><summary>This MR includes changesets to release 1 package</summary>
  | Name         | Type  |
| ------------ | ----- |
| custom-theme | Patch |
</details>
Not sure what this means? [Click here  to learn what changesets are](https://github.com/changesets/changesets/blob/master/docs/adding-a-changeset.md).
[Click here if you're a maintainer who wants to add another changeset to this MR](https://REDACTEDREDACTED-/new/test/changesets-gitlab-new-version?file_name=.changeset/lucky-memes-invent.md&file=---%0A%0A---%0A%0ADraft%3A%20feat%3A%20update%20changesets-gitlab%0A)
__Generated By Changesets GitLab Bot__
username group_114_bot_HASH
random undefined
Generated By Changesets GitLab Bot
group_114_bot_HASH
noteauthorusername max.karkowski
note.body added 1 commit
<ul><li>cc894f9d - feat: add another word</li></ul>
[Compare with previous version](REDACTED-/merge_requests/482/diffs?diff_id=291466&start_sha=9a6b30ca65b0803684ddc68f9ca4d793de4b5a6a)
username group_114_bot_HASH
random undefined
else block;

@JounQin
Copy link
Member

JounQin commented Dec 19, 2023

@maxkarkowski You'd better to log note.author.username, username at the same time outside, instead of in the if condition.

@maxkarkowski
Copy link
Author

maxkarkowski commented Dec 19, 2023

@maxkarkowski You'd better to log note.author.username, username at the same time outside, instead of in the if condition.

function isChangesetBotNote(note, username, random) {
  console.log("noteauthorusername", note.author.username);
  console.log("username", username);
  if (
    note.author.username === username ||
    (random &&
      note.author.username.match(RANDOM_BOT_NAME_PATTERN)?.[1] === username)
  ) {
    note.body.includes(generatedByBotNote);
  } else {
    console.log("else block;");
  }
}

result -->

noteauthorusername max.karkowski
username group_114_bot_random-hash
else block;
noteauthorusername max.karkowski
username group_114_bot_random-hash
else block;
noteauthorusername max.karkowski
username group_114_bot_random-hash
else block;
noteauthorusername max.karkowski
username group_114_bot_random-hash
else block;
noteauthorusername max.karkowski
username group_114_bot_random-hash
else block;
noteauthorusername max.karkowski
username group_114_bot_random-hash
else block;
noteauthorusername max.karkowski
username group_114_bot_random-hash
else block;
noteauthorusername group_114_bot_random-hash
username group_114_bot_random-hash
noteauthorusername max.karkowski
username group_114_bot_random-hash
else block;
noteauthorusername group_114_bot_random-hash
username group_114_bot_random-hash
noteauthorusername max.karkowski
username group_114_bot_random-hash
else block;
getNoteInfo username group_114_bot_random-hash
noteauthorusername max.karkowski
username group_114_bot_random-hash
else block;
noteauthorusername max.karkowski
username group_114_bot_random-hash
else block;
noteauthorusername max.karkowski
username group_114_bot_random-hash
else block;
noteauthorusername max.karkowski
username group_114_bot_random-hash
else block;
noteauthorusername max.karkowski
username group_114_bot_random-hash
else block;
noteauthorusername max.karkowski
username group_114_bot_random-hash
else block;
noteauthorusername max.karkowski
username group_114_bot_random-hash
else block;
noteauthorusername group_114_bot_random-hash
username group_114_bot_random-hash
noteauthorusername max.karkowski
username group_114_bot_random-hash
else block;
noteauthorusername group_114_bot_random-hash
username group_114_bot_random-hash
noteauthorusername max.karkowski
username group_114_bot_random-hash
else block;

and again with GITLAB_CI_USER_NAME (just to test it)

getNoteInfo username group_114_bot2
noteauthorusername max.karkowski
username group_114_bot2
note.body.includes(generatedByBotNote) false
else block;
noteauthorusername max.karkowski
username group_114_bot2
note.body.includes(generatedByBotNote) false
else block;
noteauthorusername max.karkowski
username group_114_bot2
note.body.includes(generatedByBotNote) false
else block;
noteauthorusername max.karkowski
username group_114_bot2
note.body.includes(generatedByBotNote) false
else block;
noteauthorusername max.karkowski
username group_114_bot2
note.body.includes(generatedByBotNote) false
else block;
noteauthorusername max.karkowski
username group_114_bot2
note.body.includes(generatedByBotNote) false
else block;
noteauthorusername max.karkowski
username group_114_bot2
note.body.includes(generatedByBotNote) false
else block;
noteauthorusername group_114_bot_random-hash
username group_114_bot2
note.body.includes(generatedByBotNote) true
else block;
noteauthorusername max.karkowski
username group_114_bot2
note.body.includes(generatedByBotNote) false
else block;
noteauthorusername group_114_bot_random-hash
username group_114_bot2
note.body.includes(generatedByBotNote) true
else block;
noteauthorusername max.karkowski
username group_114_bot2
note.body.includes(generatedByBotNote) false
else block;
noteauthorusername group_114_bot_random-hash
username group_114_bot2
note.body.includes(generatedByBotNote) true
else block;
noteauthorusername group_114_bot_random-hash
username group_114_bot2
note.body.includes(generatedByBotNote) true
else block;
noteauthorusername max.karkowski
username group_114_bot2
note.body.includes(generatedByBotNote) false
else block;
getNoteInfo username group_114_bot2
noteauthorusername max.karkowski
username group_114_bot2
note.body.includes(generatedByBotNote) false
else block;
noteauthorusername max.karkowski
username group_114_bot2
note.body.includes(generatedByBotNote) false
else block;
noteauthorusername max.karkowski
username group_114_bot2
note.body.includes(generatedByBotNote) false
else block;
noteauthorusername max.karkowski
username group_114_bot2
note.body.includes(generatedByBotNote) false
else block;
noteauthorusername max.karkowski
username group_114_bot2
note.body.includes(generatedByBotNote) false
else block;
noteauthorusername max.karkowski
username group_114_bot2
note.body.includes(generatedByBotNote) false
else block;
noteauthorusername max.karkowski
username group_114_bot2
note.body.includes(generatedByBotNote) false
else block;
noteauthorusername group_114_bot_random-hash
username group_114_bot2
note.body.includes(generatedByBotNote) true
else block;
noteauthorusername max.karkowski
username group_114_bot2
note.body.includes(generatedByBotNote) false
else block;
noteauthorusername group_114_bot_random-hash
username group_114_bot2
note.body.includes(generatedByBotNote) true
else block;
noteauthorusername max.karkowski
username group_114_bot2
note.body.includes(generatedByBotNote) false
else block;
noteauthorusername group_114_bot_random-hash
username group_114_bot2
note.body.includes(generatedByBotNote) true
else block;
noteauthorusername group_114_bot_random-hash
username group_114_bot2
note.body.includes(generatedByBotNote) true
else block;
noteauthorusername max.karkowski
username group_114_bot2
note.body.includes(generatedByBotNote) false
else block;

@JounQin
Copy link
Member

JounQin commented Dec 19, 2023

image
noteauthorusername group_114_bot_random-hash
username group_114_bot_random-hash

Shouldn't this match? It seems you didn't return the result?

@maxkarkowski
Copy link
Author

image ``` noteauthorusername group_114_bot_random-hash username group_114_bot_random-hash ```

Shouldn't this match? It seems you didn't return the result?

what do you mean exactly?

@JounQin
Copy link
Member

JounQin commented Dec 19, 2023

@maxkarkowski

- note.body.includes(generatedByBotNote);
+ return note.body.includes(generatedByBotNote);

@maxkarkowski
Copy link
Author

@maxkarkowski

- note.body.includes(generatedByBotNote);
+ return note.body.includes(generatedByBotNote);

is this an bug i added by rewriting the function? :D

@JounQin
Copy link
Member

JounQin commented Dec 19, 2023

is this an bug i added by rewriting the function? :D

Yes, isChangesetBotNote is an arrow function previously, and you changed it into a regular function without return expression.

@maxkarkowski
Copy link
Author

is this an bug i added by rewriting the function? :D

Yes, isChangesetBotNote is an arrow function previously, and you changed it into a regular function without return expression.

damn it. okay. i now created a new MR in my repo with the newest version of changesets-gitlab. and i altered the gitlab_ci_user_name to the group_114_bot_random-hash user. now i will give it another try

@JounQin
Copy link
Member

JounQin commented Dec 19, 2023

You just need to remove gitlab_ci_user_name environment, or use group_114_bot instead of group_114_bot2 which does not match the token.

@maxkarkowski
Copy link
Author

You just need to remove gitlab_ci_user_name environment, or use group_114_bot instead of group_114_bot2 which does not match the token.

now it works. sorry for the inconvience. but also thanks for your quick response and your help debugging it.

@JounQin
Copy link
Member

JounQin commented Dec 19, 2023

OK, we can finally close this issue, right?


It's still worth to add a section of doc to describe this issue when using with bot username.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment