Comments (8)
A couple of notes from trying to implement this:
- the
graphql-js
library is for building a GraphQL server, not client. We decide to simplify things as much as possible by making a direct POST call to the GitLab GraphQL enpoint (using axios) - the list of projects/repositories is hard-coded inside of the
firstissue.json
file. We will have to change that file to containgithub_repositories
andgitlab_repositories
- to improve even further we might even split into this format to also allow labels definition for each source
{ "gitlab": { "repositories": [...], "labels": [...] }, "github": { "repositories": [...], "labels": [...] } }
- to improve even further we might even split into this format to also allow labels definition for each source
- we will need to extract the logic that iterates over the set of repositories into its own function then call it twice, one for
github_repositories
and one forgitlab_repositories
from verto.
Hi @nickveenhof, thanks for opening the issue!
If you can update the data generation script to be able to handle GitLab repositories, that should do the trick.
Feel free to give it a try!
from verto.
I did some preparation and I believe this graphql query should get us going. It needs to be implemented in typescript, preferably with the use of https://github.com/graphql/graphql-js as that library is already available in node-modules due to the use of the GitHub Octokit.
The query lists the first 100 projects that have issues with one of the 3 potential labels. GitLab itself uses "Quick Win". It then lists the 10 most recent issues with that label. The code should iterate over this list and transform it in the format the project expects
Missing: The project license, I believe everything else needed to get this up and running is present
{
projects(
first:100
withMergeRequestsEnabled:true
withIssuesEnabled:true
sort: "stars_desc"
) {
nodes {
name,
starCount,
openIssuesCount,
lastActivityAt,
webUrl,
languages {
name
},
topics,
lastActivityAt,
description
issues(first:10, or: { labelNames: ["quick win", "good first issue", "help wanted"]}, state:opened,sort:UPDATED_DESC, confidential:false) {
nodes {
webUrl,
userNotesCount,
title,
createdAt,
labels {
nodes { title }
}
}
}
}
}
}
You can test it out through https://gitlab.com/-/graphql-explorer
from verto.
Hey @nickveenhof, thanks for the update. Your approach is sound. You have my blessing.
from verto.
@zillemarco Thinking of the fact that there are many GitLab instances with public projects, so it would be good to take that into account if we can with simpler conventions? Can the key be gitlab.com & github.com? That way we allow, potentially later, self-hosted gitlab instances and/or GitHub enterprise (although I don't know many in the wild) to add their projects as well. Alternative is to make sure the url is added.
As to the labels, I'd keep that a global key as the query is OR anyway for both GitHub & GitLab
from verto.
Yeah, I thought about it after posting that and I think a better schema might be somewhat like this:
[
{
"provider": "github" | "gitlab" | ...
"source": "https://github.com" | "https://gitlab.com/" | ...,
"repositories": [...],
"labels": [...]
}
]
This way we might expand to even more providers (bitbucket and others for example).
I would definitely like to hear what @lucavallin thinks about this before though 🙂
from verto.
@nickveenhof @zillemarco I like the idea of potentially being able to support any repo anywhere! The structure @zillemarco looks good to me. We should also add some logic to the UI so that we can display the GitHub / GitLab logo on each item, but that's for later. I say let's go with the the structure detailed in the comment right above ^.
from verto.
Closed by #171.
from verto.
Related Issues (20)
- New Design Feature for Enhanced UI HOT 1
- Intermittent Unknown Collapse Issue in Repository Section HOT 4
- Repository item layout appears to be broken for screen sizes below extra large HOT 1
- A small detail in the floating buttons :) HOT 3
- iFrame of BuyMeCoffee overflows on the top and hides the content HOT 1
- Tag Picker Display Issue with 15 or More Tags
- Use SSR functions instead of reading json directly. HOT 3
- Find a way to reduce the impact of loading data.json
- Implement search with Algolia HOT 5
- Move tests out of data directory
- Address pagespeed results. HOT 4
- Linkedin link broken. HOT 1
- Suggestion: add tag for documentation needs HOT 3
- Store and read data from a database instead of a JSON file HOT 12
- Let users register HOT 4
- Fix favicons HOT 3
- Search repos by multiple tags HOT 4
- Implement / fix user pages
- Enhancing Button Styles for an Attractive Look
- Add animation to SortPicker Component
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from verto.