-
Notifications
You must be signed in to change notification settings - Fork 270
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
#462 Add "CI/CD Status" column #473
base: develop
Are you sure you want to change the base?
Conversation
Thanks @keydepth for raising this pull request! I’ll review this PR in the next few days - I’m just finishing the implementation and testing of a feature that I’ve committed to deliver in Git Graph 1.30.0, and need to get a beta release out for it ASAP. |
I found a lot of typo and fixed typo "CI/DI" to "CI/CD". commit 64ec2cd |
@mhutchie |
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.
Hi @keydepth,
Firstly, thank you for raising the pull request! It's great to have a functional implementation of this feature request.
There are a number of changes required before this functionality is production ready, please address them:
DataSource.getCICDs
blocks the loading of the Git Graph View until all API requests (relatively slow) are made. The Git Graph View must always be responsive, soDataSource.getRepoInfo
&DataSource.getCommits
are extremely streamlined to make the commits load as quickly as possible. Anything used to enrich the commits, that can be done later, should be done later. For example, avatars are only fetched after the commits have loaded - this ensures commits always load first and can be interacted with as quickly as possible, and the avatars are loaded afterwards (without preventing the user from doing anything). This is definitely the case for this feature.- Even in a repository with ~300 builds, the view's load time has increased by over four seconds by having to make three API requests. As a large portion of Git Graph users work in repositories with thousands of commits & builds, the current implementation is simply not feasible. Additionally, by using
Promise.all
to load all subsequent pages of data simultaneously, if the number of pages was large I'd expect the API's to start blocking the requests due to them being overloaded.
- Even in a repository with ~300 builds, the view's load time has increased by over four seconds by having to make three API requests. As a large portion of Git Graph users work in repositories with thousands of commits & builds, the current implementation is simply not feasible. Additionally, by using
- Every time the Git Graph View refreshes, it has to re-fetch all of the builds via the API's. This is quite wasteful, so it would be best if a caching mechanism was implemented to reduce the number of calls made to the API's.
- The
DataSource
class is meant to focus on running Git commands and parsing their output. It would be best ifDataSource.getCICDs
was moved into it's own class (like./src/avatarManager.ts
), and the DataSource just requests CI/CD information from it. - The worded statuses (e.g. "success", "failure") should likely be replaced with coloured
SVG_ICONS
(e.g.SVG_ICONS.passed
&SVG_ICONS.failed
). This would make it easier for users to spot a red/failed build, out of all of the green/passed builds. - Many users have expressed that they want as much space to be available for the Graph & Description columns as possible (especially those who work on laptops with lower screen resolutions). I think many of these users would find the current additional column too wide. I can think of two options to resolve this (but feel free to try out some of your own):
- Use a shorter column name (e.g. "CI/CD") and the
SVG_ICONS
in (4), to reduce the column width. - Move the
SVG_ICONS
in (4) to the end of the Description column text (similar to how GitHub does it). This removes the need to have any additional column.
- Use a shorter column name (e.g. "CI/CD") and the
- For such a complex piece of code with API integrations, it would be useful to have more logging. This would allow users to see when API calls are made, and more information if they fail.
- I try to keep the extension as lean as possible. By including the
request
andrequest-promise
dependencies, they transitively added 48 new dependencies of the extension (almost 5.5Mb in size) - making the extension over 6.5 times bigger than it's current size. While I wouldn't mind this if the dependencies offered significant value, all you're using them for is to simplify making HTTPS GET requests. In contrast, this could equally be achieved by creating a./src/utils.ts
method that wraps an HTTPS GET request in a promise in roughly 20 lines of code (this is definitely my preference).
@mhutchie I want you just idea of (6)How to notify API error to user. I'll update this code. (^o^) |
Hi @keydepth, Thanks for your response, and that you understand my point of view! I really appreciate that you want to work on this feature request, have already implemented a great and fully-functional solution, and are willing to make some code improvements to refine the solution. For (6):
|
Hello! @mhutchie Thank you for your advice. |
Hello! @mhutchie I'v updated CI/CD status as below. (1) |
Hello! @mhutchie Thank you for your review and great comment. I want you the idea of (5) tokens encryption,
Is this method acceptable? |
Hi @keydepth, Yes, using the Node.js |
Hello! @mhutchie
I used GitHub API "/repos/{owner}/{repo}/actions/runs". This API can take lists all workflow runs for a repository. It seems a reasnable API to get action results for reduce API call. To get external result of CI/CD, I found another GitHub API "/repos/{owner}/{repo}/commits/{ref}/check-runs". So, I used actions/runs in overview table and check-runs in detail view. |
While I understand the limitations you’ve found so far with the GitHub API’s, from a users perspective the inconsistency will almost certainly lead to confusion, or worse still, mislead them into thinking that the all builds were successful, when it’s possible some builds failed (but they just aren’t shown in the CI/CD column). If there just isn’t a way to work around this (with the GitHub API’s, or others), I’d almost be tempted to only show the build statuses in the Commit Details View (and not in a CI/CD column). This eliminates any confusion, and significantly simplifies the implementation. |
Hello. @mhutchie I understood your point of view. I think this limitation is not acceptable. User mislead is reduce quality of this extention. In this time, I will change this PR only show the build statuses in the Commit Details View. |
Hello. @mhutchie I've implemented CD/CD.
|
Hello. @mhutchie Oops. I have mistake the date format of test case. My envirnment is ... GitHub environment is ... |
Hello. @mhutchie Oops, again. I have mistaken the LINT of test case. |
Hi @keydepth, For a number of reasons outside of my control I've been unable to work on the extension much the last few weeks. I'm currently just finishing the last features for Git Graph 1.31.0, which I then need to test and release as soon as possible. I'll review your changes as soon as Git Graph 1.31.0 is released. Apologies for the delay. |
Hello! @mhutchie If you have time, please review this PR. |
Issue Number / Link: #462
Summary of the issue:
Implemented the "CI/DI Status" column feature
Description outlining how this pull request resolves the issue:
"CI/DI Status" column
Configuration Menu
Configuration Dialog