-
Notifications
You must be signed in to change notification settings - Fork 12
Bugfix: Count github app usage by owner instead of watermelon_user #313
Conversation
…uses) passing the owner instead of the watermelon_user as the parameter to increase the count by
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
WatermelonAI SummaryThe two commits in this Pull Request focus on updating the logic for counting Watermelon's usage on personal and organizational repos. The first commit creates and calls a new stored procedure that takes the owner of the repo as a parameter, instead of the watermelon user. This change allows for differentiating between personal and organizational usage. The second commit merges the development branch into the bugfix/user-or-org-to-gh-app branch. The PR aims to fix the bug by counting the github app usage by owner instead of the watermelon user. GitHub PRsClick here to login to Jira |
let query = await executeRequest( | ||
`EXEC dbo.increment_github_app_uses @watermelon_user = '${watermelon_user}'` | ||
`EXEC dbo.increment_owner_github_app_uses @watermelon_user = '${owner}'` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does this work for forks?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For example, in this repo, people need to fork it to open a PR, but when the PR is run it will count against the "watermelontools" owner, not the contributor one, and we'll miss the chance of adding a new user.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First of all, we don't limit open-source usage so if people are forking a repo of such kind it doesn't matter.
But even if we did, or in the future we decide that we want to do so, we can choose not to add to the count if the repo is a fork. Octokit allows us to determine if a repo is a fork or not via various methods. One of them could be calling octokit.rest.repos.get
and checking if the parent
and source
props exist for that repo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stamp.
let query = await executeRequest( | ||
`EXEC dbo.increment_github_app_uses @watermelon_user = '${watermelon_user}'` | ||
`EXEC dbo.increment_owner_github_app_uses @watermelon_user = '${owner}'` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stamp.
Description
The goal of this PR is to differentiate Watermelon's usage on a personal vs an organizational repo in terms of counting usage.
Previously we measured by watermelon_user with a query that retrieved the UserTeam this watermelon_user is part of and then increasing the count to that UserTeam. The problem with this is that it doesn't differentiate between personal and organizational usge. We know that people like testing this tool (as similar tools) on personal repos before taking them to their organizational repos. Therefore it's important to make such diferentiation.
Type of change
Notes
The old stored procedure,
increment github_app_uses
, hasn't been deletedAcceptance