Closed joannenolan-sky closed 5 years ago
I've created https://github.com/nikku/wuffle/issues/41 to track the integration of checks and statuses onto PR cards.
Hi @joannenolan-sky, sorry for not getting back to you for on this one earlier.
The just released version v0.23.0
of the board lays the foundation for implementing this feature outside the core. Specifically, I added two things:
store#updateIssue
allows partial updates (such as attaching or updating the status
on a PR)A blueprint for such an extension is review support, implemented via https://github.com/nikku/wuffle/commit/eff80ed319016d62d9ba20ca0f56d962b4bfa912.
Looking into your PR I see that you create additional APIs and stores to keep status related information. This has a couple of issues, mainly increased complexity and need for manual cleanup.
Taking the reviews approach into account, you could do the following:
whenever a PR is created or the head commit changes, attach the relevant status to it:
store.updateIssue({
id,
ref_status
});
whenever a status update is published by GitHub, search the PRs for the relevant head commit and update the PRs accordingly
Would you still like to see this feature in the core?
I will look into the changes you have suggested and see if it will work for what I need. I still think it would be useful to have in core though as we have been using the status bar for the last few months and it has been extremely useful, so much so we now depend on it
I still think it would be useful to have in core though.
It will be part of the project but separated into its own component. So in a way, it be part of the core, of course.
You may hook into issue updates in the store via the following:
events.on('store.issueUpdated', event => {
const { existingIssue, update, updatedIssue } = event;
// check whether it is a PR and the sha changed, if that is the case,
// fetch the status and update it later on via
store.updateIssue({ id: issue.id, status: fetchedStatus });
});
I've added the checks and status display UI via #53:
So this is something you can drop from your PR and reuse what's there instead.
@nikku cool, I will rework my PR
Went ahead and implemented it myself, cf. https://github.com/nikku/wuffle/pull/64.
Closing this PR in favor of https://github.com/nikku/wuffle/pull/64.
As per the screenshot , we would like to see the status of a PR . This will enable us to quickly see if a PR has failed its tests.
To get this information we need to subscribe to status events. This will give us the status information for a sha of a branch.
To enable this in Wuffle we need the following fields:
We can then track the status of a sha and the context states in the following format
A status event occurs whenever a branch is pushed, so it can occur before a Pull request is raised. This means we need to store it separately from an issues, similar to links.
There is also some work to get the status if when the background sync is occurring. This returns the combined status so the fields we will need are: