-
-
Notifications
You must be signed in to change notification settings - Fork 184
Load issues dynamically in the Issue Finder #543
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
Conversation
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.
As a side-effect, this fixes the issue of wrong colours being applied to the skill labels.
webpack/js/components.js
Outdated
@@ -178,6 +178,20 @@ export const App = { | |||
const BASE_URL = 'https://raw.githubusercontent.com/creativecommons/ccos-scripts/master/normalize_repos' | |||
const FILE_URL = name => `${BASE_URL}/${name}.json` | |||
|
|||
const octokit = new Octokit(); | |||
octokit.search.issuesAndPullRequests({ | |||
q: 'org:creativecommons is:open is:issue label:"help wanted"', |
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.
Should we remove the issues awaiting triage?
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.
I think we should add a separate filter for issues awaiting triage.
webpack/js/components.js
Outdated
const octokit = new Octokit(); | ||
octokit.search.issuesAndPullRequests({ | ||
q: 'org:creativecommons is:open is:issue label:"help wanted"', | ||
per_page: 100 |
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.
I've observed this number to be ~60 so we can skip pagination for now.
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.
@dhruvkb the code for this looks fine, but I'm concerned about making this dependent on JavaScript. One of the advantages of having a static site is that it doesn't depend on JavaScript, if we're just using JavaScript for filtering, it can gracefully degrade.
webpack/js/components.js
Outdated
@@ -178,6 +178,20 @@ export const App = { | |||
const BASE_URL = 'https://raw.githubusercontent.com/creativecommons/ccos-scripts/master/normalize_repos' | |||
const FILE_URL = name => `${BASE_URL}/${name}.json` | |||
|
|||
const octokit = new Octokit(); | |||
octokit.search.issuesAndPullRequests({ | |||
q: 'org:creativecommons is:open is:issue label:"help wanted"', |
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.
I think we should add a separate filter for issues awaiting triage.
@kgodey the content changes so dynamically that we're seeing almost 24 bot commits a day. In cases like this, can we not justify the use of JavaScript? |
@dhruvkb I don't see what bot commits have to do with JavaScript or the architecture of the project. In any case, I merged creativecommons/ccos-scripts#94 which should reduce bot commits. |
@kgodey using JavaScript to fetch issues dynamically eliminates the need to keep a databag and sync it hourly. The data will always be fresh and up-to-date. Adding new filters (such as issues that need triage) is also easier because data is being fetched on demand from GitHub which would otherwise need another databag to be created and pushed hourly. |
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.
The code here looks great to me, I think I agree with Dhruv on the use of JS. I think that the advantages posed by using JS far outweigh the disadvantages. The JS used seems to be pretty standard so in terms of being reliant on it, it seems pretty innocuous.
I do agree that I don't like being dependent on third party packages any more than is needed, but the functionality seems worth it to me.
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.
I am pleased with the changes and approach taken here. Nice work @dhruvkb
Now there's an option to find issues that have the label While I agree 100% on @kgodey's points in favour of the static site, this JS based client-side approach proves how easy it is to extend the issue finder when adding new functionality. |
Fixes
Fixes #542 by @dhruvkb
Fixes #523 by @dhruvkb
Description
This PR uses the Octokit Search API which is not authenticated to find and display issues.
Technical details
This removes the need for the hourly pull and push in
ccos-scripts
and will also reduce the bot commits to the repo.Checklist
Update index.md
).main
ormaster
).visible errors.
Developer Certificate of Origin
Developer Certificate of Origin