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

Fix GitLab's ready for review hook #936

Merged
merged 3 commits into from
May 22, 2024

Conversation

zecakeh
Copy link
Contributor

@zecakeh zecakeh commented May 16, 2024

The code resulted on this error when there was a title change (rest of the stack trace omitted):

[Bridge] Connection GitLabRepo http://gitlab.local/group/website failed to handle gitlab.merge_request.update: TypeError: Cannot read properties of undefined (reading 'startsWith')
  at GitLabRepoConnection.onMergeRequestUpdate (~/Projets/matrix/hookshot/src/Connections/GitlabRepo.ts:630:53)

As far back as I could go in the docs (GitLab 14.10), the keys for changes have been previous and current. Besides, there is a draft change that we can use directly instead of guessing from the title.

I removed the [key: string] type declaration because the type of the value depends on the key of the change.

As far back as I could go in the docs (GitLab 14.10),
the keys for changes have been `previous` and `current`.

There is a `draft` change that
we can use directly
instead of guessing from the title.
The type of the value depends on
the key of the change.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
@zecakeh zecakeh requested a review from a team as a code owner May 16, 2024 16:14
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
Copy link
Contributor

@Half-Shot Half-Shot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you can do a changelog entry for this one, it'll be good to go 👍 . Thanks!

@zecakeh
Copy link
Contributor Author

zecakeh commented May 22, 2024

Woops, I had forgotten to push the commit 😅

@zecakeh zecakeh requested a review from Half-Shot May 22, 2024 11:12
@Half-Shot Half-Shot enabled auto-merge May 22, 2024 12:11
@Half-Shot Half-Shot added this pull request to the merge queue May 22, 2024
Merged via the queue into matrix-org:main with commit 2bffd5c May 22, 2024
12 checks passed
@zecakeh zecakeh deleted the gitlab-ready-for-review branch May 22, 2024 12:40
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.

None yet

2 participants