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

Feat/46 #47

Merged
merged 2 commits into from
Sep 2, 2024
Merged

Feat/46 #47

merged 2 commits into from
Sep 2, 2024

Conversation

rndquu
Copy link
Contributor

@rndquu rndquu commented Aug 30, 2024

Related to #46

P.S. Some ts types are updated, not sure if it breaks something

@rndquu rndquu marked this pull request as ready for review August 30, 2024 17:11
Copy link
Member

@0x4007 0x4007 left a comment

Choose a reason for hiding this comment

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

Can you explain why issue id has collisions? This should be unique

@Keyrxng
Copy link
Contributor

Keyrxng commented Aug 31, 2024

https://github.com/ubiquibot/conversation-rewards/blob/9853408f7735bebc50eb2679f118ca82b3cac0c0/src/parser/permit-generation-module.ts#L49

The conversation-rewards plugin is passing in issue.id so we'll need to update that or permits will be broken

Copy link
Member

@gentlementlegen gentlementlegen left a comment

Choose a reason for hiding this comment

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

I am good with the changes, but how come this didn't break before?

@rndquu
Copy link
Contributor Author

rndquu commented Aug 31, 2024

Can you explain why issue id has collisions? This should be unique

I remember there was a long github thread at https://github.com/orgs/community/discussions regarding why node_id should be used instead of id but I couldn't find it. The closest thing I found is this post.

In short:

  1. node_id supersedes id and is guaranteed to be unique as stated here: These IDs will be unique, therefore you can rely on them directly as references.
  2. Github object id's may be changed over time as mentioned here

node_id is basically a base64 encoded string of {type_id}:{type_name}{resource_id}.

Example:

$ echo "MDEwOlJlcG9zaXRvcnkxMzkwOTU1Mzc=" | base64 --decode
010:Repository139095537

So if multiple repositories (or issues, PRs, users, etc...) have the same resource id their node_id will be different because of the type_name used.

@rndquu
Copy link
Contributor Author

rndquu commented Aug 31, 2024

https://github.com/ubiquibot/conversation-rewards/blob/9853408f7735bebc50eb2679f118ca82b3cac0c0/src/parser/permit-generation-module.ts#L49

The conversation-rewards plugin is passing in issue.id so we'll need to update that or permits will be broken

Let me double check

@rndquu rndquu marked this pull request as draft August 31, 2024 07:46
@rndquu
Copy link
Contributor Author

rndquu commented Aug 31, 2024

I am good with the changes, but how come this didn't break before?

It was broken. conversation-rewards plugin incorrectly passes issue number instead of issue id hence the collision occurred for a contributor who solved issue with the same number in different organization repositories.

https://github.com/ubiquibot/conversation-rewards/blob/9853408f7735bebc50eb2679f118ca82b3cac0c0/src/parser/permit-generation-module.ts#L49

The conversation-rewards plugin is passing in issue.id so we'll need to update that or permits will be broken

I'll make a PR

@rndquu rndquu merged commit c01a2b2 into ubiquity-os:development Sep 2, 2024
2 checks passed
@rndquu rndquu deleted the feat/46 branch September 2, 2024 06:53
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