guibranco / projects-monitor

⚙️🔔 GitHub projects monitor
https://guilherme.straccini.com/projects-monitor/
MIT License
3 stars 0 forks source link

[FEATURE] Grab information from Codacy #21

Open guibranco opened 1 year ago

guibranco commented 1 year ago

Description:

We need to fetch and store relevant information from Codacy for each of our repositories. The project already has an integration class that interacts with the Codacy API, so the task focuses on querying the repositories from the database, calling the Codacy API, and saving relevant information in a new dedicated table. The table should store only the essential details, not the full detailed data.

Objectives:

  1. Query the Repositories Table:

    • Retrieve the list of repositories from the existing repositories table.
  2. Call Codacy API for Each Repository:

    • Use the existing Codacy integration class to call the API for each repository.
  3. Create a New Database Table:

    • Create a new dedicated table to store relevant information from Codacy (e.g., repository name, code quality score, issues count, etc.).
  4. Store Codacy Data:

    • Parse the API response and insert the relevant data into the new table.

Tasks:

Code Example:

Here’s a pseudo-code example of how the process might look:

// Query repositories from database
$repositories = $database->query('SELECT id, name FROM repositories');

foreach ($repositories as $repository) {
    // Use Codacy integration to fetch data
    $codacyData = $codacyIntegration->fetchRepositoryData($repository['name']);

    // Parse relevant data from Codacy API response
    $qualityScore = $codacyData['quality_score'];
    $issuesCount = $codacyData['issues_count'];

    // Insert relevant data into new table
    $database->query('INSERT INTO codacy_info (repository_id, quality_score, issues_count) VALUES (?, ?, ?)', 
                      [$repository['id'], $qualityScore, $issuesCount]);
}

Acceptance Criteria:

Additional Context:

This feature will provide an overview of each repository's code quality and issues based on Codacy data. By storing only the relevant information, we ensure that the database remains efficient and easy to query for dashboards or reporting purposes.

gitauto-ai[bot] commented 3 weeks ago

Hey, I'm a bit lost here! Not sure which file I should be fixing. Could you give me a bit more to go on? Maybe add some details to the issue or drop a comment with some extra hints? Thanks!

Have feedback or need help? Feel free to email info@gitauto.ai.