Giter Club home page Giter Club logo

Comments (8)

zillemarco avatar zillemarco commented on August 18, 2024 1

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 contain github_repositories and gitlab_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": [...]
            }
      }
  • 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 for gitlab_repositories

from verto.

lucavallin avatar lucavallin commented on August 18, 2024

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.

nickveenhof avatar nickveenhof commented on August 18, 2024

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.

lucavallin avatar lucavallin commented on August 18, 2024

Hey @nickveenhof, thanks for the update. Your approach is sound. You have my blessing.

from verto.

nickveenhof avatar nickveenhof commented on August 18, 2024

@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.

zillemarco avatar zillemarco commented on August 18, 2024

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.

lucavallin avatar lucavallin commented on August 18, 2024

@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.

lucavallin avatar lucavallin commented on August 18, 2024

Closed by #171.

from verto.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.