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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why
I think Event Type
pull_request
andmerge_request
are the following webhook events.According to their specification documents, the payload does not contain a
commits
field. In the query to generate thechanges
view,UNNEST(JSON_EXTRACT_ARRAY(e.metadata, '$.commits')
is executed.However, event_type
pull_request
andmerge_request
are excluded by theUNNEST
function because they don't havecommits
field for the reason mentioned above.Relation
The query that considers the
metadata.commits
field in theevents_raw
table was changed in PR #132. Before PR #132, the id of event_typepull_request
andmerge_request
were shown aschange_id
in thechanges
view.However, the id of event_type
pull_request
andmerge_request
are formatted as$repository_name/$number
, which does not represent the SHA of the commit. Also, the metadata for the event_typepull_request
andmerge_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.