Skip to content
This repository has been archived by the owner on Jan 23, 2024. It is now read-only.

Fix the query to generate the changes view #211

Merged
merged 1 commit into from
Sep 14, 2021

Conversation

na-ga
Copy link
Contributor

@na-ga na-ga commented Sep 14, 2021

Why

I think Event Type pull_request and merge_request are the following webhook events.

According to their specification documents, the payload does not contain a commits field. In the query to generate the changes view, UNNEST(JSON_EXTRACT_ARRAY(e.metadata, '$.commits') is executed.

However, event_type pull_request and merge_request are excluded by the UNNEST function because they don't have commits field for the reason mentioned above.

Relation

The query that considers the metadata.commits field in the events_raw table was changed in PR #132. Before PR #132, the id of event_type pull_request and merge_request were shown as change_id in the changes view.

However, the id of event_type pull_request and merge_request are formatted as $repository_name/$number, which does not represent the SHA of the commit. Also, the metadata for the event_type pull_request and merge_request does not have a field representing the SHA of the commit.

So we can change the query that builds the changes view to target only event_type push, instead of treating it as before PR #132. Please advise me if my understanding is wrong.

@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Sep 14, 2021
@dinagraves dinagraves merged commit 5aad04c into dora-team:main Sep 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants