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: multiple prs handling #132

Merged

Conversation

gentlementlegen
Copy link
Member

@gentlementlegen gentlementlegen commented Sep 26, 2024

Resolves #128
Depends on #121
QA: Meniole#17 (comment)

@gentlementlegen
Copy link
Member Author

I realized while testing this that there is a part that maybe we didn't take into account: which PR do we consider for the rewards? Because this would be dependent on the order they get closed right now.

@0x4007
Copy link
Member

0x4007 commented Oct 3, 2024

I realized while testing this that there is a part that maybe we didn't take into account: which PR do we consider for the rewards? Because this would be dependent on the order they get closed right now.

All of them but it should only render the rewards when the last one is closed.

Comment on lines +19 to +21
const result = logger.error("All linked pull requests must be closed to generate rewards.");
await githubCommentModuleInstance.postComment(result.logMessage.diff);
return result.logMessage.raw;
Copy link
Member

@0x4007 0x4007 Oct 3, 2024

Choose a reason for hiding this comment

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

I thought our logger abstracts all this away. Why not just add a param postComment: boolean in the logger methods? I'm pretty sure I implemented that the first go around. It was the third parameter I believe.

(message: string, metadata: Record<key, value>, postComment: boolean)

Copy link
Member Author

Choose a reason for hiding this comment

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

Because we wanted to separate Supabase from the logger for a few reasons:

  • it would require every project to link to Octokit
  • that would force every project to include Octokit which differs in use between Actions and Workers
  • some do no need to log them (mostly actions) as the logs are saved within the Action run (and now within worker with the new Logs)

My suggestion was to have optional packages that you can add on init, like Octokit does if you want to use pagination for example, where we could link a package that would post comments.

Copy link
Member

Choose a reason for hiding this comment

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

I think you can file a spec before it's forgotten about

Copy link
Member Author

@gentlementlegen gentlementlegen Oct 4, 2024

Choose a reason for hiding this comment

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

There was a task carried out about this I remember, let me find it.
ubiquity-os/ubiquity-os-logger#35

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.

Based on QA seems fine.

@0x4007 0x4007 merged commit 79b98dd into ubiquity-os-marketplace:development Oct 3, 2024
3 checks passed
@gentlementlegen gentlementlegen deleted the feat/multiple-prs branch October 4, 2024 03:55
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.

Don't Render Rewards If Multiple Pulls Are Linked
2 participants