Skip to content

Create a ScanCode.io pipeline to integrate Grimoire - #2202

Merged
ziadhany merged 24 commits into
aboutcode-org:mainfrom
ziadhany:grimoirelab
Sep 11, 2026
Merged

Create a ScanCode.io pipeline to integrate Grimoire#2202
ziadhany merged 24 commits into
aboutcode-org:mainfrom
ziadhany:grimoirelab

Conversation

@ziadhany

@ziadhany ziadhany commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator

@ziadhany
ziadhany force-pushed the grimoirelab branch 2 times, most recently from 5b50e5e to cb46931 Compare August 4, 2026 11:54
@ziadhany
ziadhany marked this pull request as ready for review August 4, 2026 11:55
@ziadhany
ziadhany requested a review from TG1999 August 6, 2026 11:01
@ziadhany

ziadhany commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator Author

The pipeline input is:
https://github.com/expressjs/express.git

The expected JSON output file is:

{
  "repository": "https://github.com/expressjs/express.git",
  "score": {
    "value": 1.3072185774554448e-93,
    "metadata": {
      "ecosystem": "npm",
      "model": "health",
      "version": "0.1"
    }
  },
  "metrics": {
    "total_commits": 133,
    "total_contributors": 40,
    "total_organizations": 7,
    "pony_factor": 2,
    "elephant_factor": 1,
    "recent_organizations": 7,
    "recent_contributors": 40,
    "recent_commits": 133,
    "contributor_growth": -8,
    "contributor_growth_rate": -0.2962962962962963,
    "active_branches": 29,
    "days_since_last_commit": 1,
    "casual_regular_contributors_rate": 0.0,
    "returning_contributors": 0,
    "commits_over_periods_rate": 1.0,
    "coefficient_of_variation": 0.4666502450882076,
    "file_types_code": 56,
    "file_types_binary": 0,
    "file_types_other": 188,
    "commit_size_added_lines": 1562,
    "commit_size_removed_lines": 981,
    "message_size_total": 53218,
    "message_size_mean": 400.1353383458647,
    "message_size_median": 312,
    "developer_categories_core": 13,
    "developer_categories_regular": 27,
    "developer_categories_casual": 0,
    "commits_per_week": 2.5506849315068494,
    "commits_per_month": 10.931506849315069,
    "commits_per_year": 133.0,
    "found_file_license": 1,
    "found_file_adopters": 0
  }
}

Comment thread scanpipe/pipelines/scan_repo_grimoirelab.py Outdated
@ziadhany
ziadhany requested a review from TG1999 August 12, 2026 20:59
Comment thread scanpipe/pipelines/scan_repo_grimoirelab.py Outdated
Comment thread scanpipe/pipelines/scan_repo_grimoirelab.py Outdated
Comment thread scancodeio/settings.py Outdated
Comment thread scanpipe/pipelines/scan_repo_health.py Outdated
Signed-off-by: ziad hany <ziadhany2016@gmail.com>
Add a test for ScanRepoGrimoirelabTest
Remove hardcoded env variable

Signed-off-by: ziad hany <ziadhany2016@gmail.com>
Signed-off-by: ziad hany <ziadhany2016@gmail.com>
Validate VCS URL
Add a test
Update Grimoirelab to use the minimal setting

Signed-off-by: ziad hany <ziadhany2016@gmail.com>
Signed-off-by: ziad hany <ziadhany2016@gmail.com>
Replace git:// with https://

Signed-off-by: ziad hany <ziadhany2016@gmail.com>
Signed-off-by: ziad hany <ziadhany2016@gmail.com>
Signed-off-by: ziad hany <ziadhany2016@gmail.com>
Fix the tests.
Ensure the pipeline runs only when it is correctly configured.

Signed-off-by: ziad hany <ziadhany2016@gmail.com>
Fix the test

Signed-off-by: ziad hany <ziadhany2016@gmail.com>
Add more validation over format_metrics_output step

Signed-off-by: ziad hany <ziadhany2016@gmail.com>
Signed-off-by: ziad hany <ziadhany2016@gmail.com>
Signed-off-by: ziad hany <ziadhany2016@gmail.com>
Signed-off-by: ziad hany <ziadhany2016@gmail.com>
Fix a typo

Signed-off-by: ziad hany <ziadhany2016@gmail.com>
Signed-off-by: ziad hany <ziadhany2016@gmail.com>
Signed-off-by: ziad hany <ziadhany2016@gmail.com>
Signed-off-by: ziad hany <ziadhany2016@gmail.com>

@keshav-space keshav-space left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ziadhany, LGTM! few minor nits for your consideration.

Comment thread scanpipe/pipelines/scan_repo_health.py Outdated
Comment thread scanpipe/pipelines/scan_repo_health.py Outdated
Comment thread scanpipe/pipelines/scan_repo_health.py Outdated
Signed-off-by: ziad hany <ziadhany2016@gmail.com>
@ziadhany

ziadhany commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator Author

@keshav-space I just updated the error messages and the function docstring.
Please have another look when you get a chance.

Signed-off-by: ziad hany <ziadhany2016@gmail.com>
Comment thread scanpipe/pipelines/scan_repo_health.py Outdated
Update the scan repo health expected output

Signed-off-by: ziad hany <ziadhany2016@gmail.com>
@ziadhany

ziadhany commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator Author

@keshav-space I just added the docs for the pipeline and its configuration. Please review them when you have some time.

Screenshot 2026-09-10 at 17-11-22 Scan repo health (Web UI) — ScanCode io documentation
Screenshot 2026-09-10 at 17-11-57 Application Settings — ScanCode io documentation

Signed-off-by: ziad hany <ziadhany2016@gmail.com>

@keshav-space keshav-space left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ziadhany, see suggestion below.

Comment thread docs/images/tutorial-web-ui-project-form-repo-health.png
Comment thread scanpipe/pipelines/scan_repo_health.py Outdated
Comment on lines +38 to +39
GRIMOIRELAB_ECOSYSTEM = environ.get("GRIMOIRELAB_ECOSYSTEM", "")
GRIMOIRELAB_PROJECT = environ.get("GRIMOIRELAB_PROJECT", "")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TG1999 @ziadhany We're hardcoding this for now?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is currently hardcoded in GrimoireLab, so the pipeline can only run with these values:

GRIMOIRELAB_ECOSYSTEM="npm-training-set"
GRIMOIRELAB_PROJECT="npm-popular-components"

We are planning to make these values configurable per ecosystem in the future.

In the meantime, according to my understanding, we will use the following hardcoded values for our pipeline:

GRIMOIRELAB_ECOSYSTEM="npm"
GRIMOIRELAB_PROJECT="health"

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@keshav-space, these will be the hardcoded values according to Tushar’s last meeting. I’ll update the docs accordingly.

GRIMOIRELAB_ECOSYSTEM="npmlargerecosystem"
GRIMOIRELAB_PROJECT="NPMMostUsed"

Comment thread scanpipe/pipelines/scan_repo_health.py Outdated
Comment thread scanpipe/pipelines/scan_repo_health.py
Fix a typo in the image documentation

Signed-off-by: ziad hany <ziadhany2016@gmail.com>
Comment thread docker.env

@keshav-space keshav-space left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ziadhany, LGTM!

Signed-off-by: ziad hany <ziadhany2016@gmail.com>
@ziadhany
ziadhany merged commit 0ffa256 into aboutcode-org:main Sep 11, 2026
8 checks passed
@ziadhany
ziadhany deleted the grimoirelab branch September 11, 2026 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

npm-health: Create a ScanCode.io pipeline to integrate Grimoire

4 participants