Skip to content

Update add_project.py to support new issue form fields (Labels and Package registries)#28

Merged
YDX-2147483647 merged 2 commits into
mainfrom
copilot/fix-27
Aug 25, 2025
Merged

Update add_project.py to support new issue form fields (Labels and Package registries)#28
YDX-2147483647 merged 2 commits into
mainfrom
copilot/fix-27

Conversation

Copilot AI commented Aug 25, 2025

Copy link
Copy Markdown
Contributor

The issue template form was updated in commit bbbdc51 to include two new fields:

  1. Labels - A checkbox section allowing users to select multiple project labels (CLI, Runnable, API, etc.)
  2. Package registries - A textarea for users to provide links to package registries like PyPI, npm, crates.io, Go packages, etc.

However, the add_project.py script only supported the original three fields (Name, URL, Category) and had TODO comments for the missing functionality.

This PR implements the missing parsers:

Labels Support:

  • Parses checkbox selections from the Labels section
  • Maps display names (e.g., "🤖 CLI") to internal label names (e.g., "cli") using the project.yaml configuration
  • Returns a labels array in the project YAML entry

Package Registries Support:

  • Extracts package IDs from various registry URLs:
    • PyPI: https://pypi.org/project/package-name/pypi_id: package-name
    • npm: https://www.npmjs.com/package/@scope/package-namenpm_id: @scope/package-name
    • Crates.io/lib.rs: https://crates.io/crates/crate-namecrates_id: crate-name
    • Go packages: https://pkg.go.dev/github.com/user/repogo_id: github.com/user/repo

Example Usage:

echo '{"body": "### Name\n\nAwesome Project\n\n### URL\n\nhttps://github.com/user/repo\n\n### Category\n\n🚀 Package development\n\n### Labels\n\n- [x] 🤖 CLI\n- [x] 🔌 API\n\n### Package registries\n\nhttps://pypi.org/project/awesome/\nhttps://crates.io/crates/awesome\n\n### Additional context\n\nGreat project!"}' | python scripts/add_project.py projects.yaml

Output:

- name: Awesome Project
  github_id: user/repo
  category: pkg
  labels: ['cli', 'api']
  pypi_id: awesome
  crates_id: awesome

The implementation handles edge cases like empty selections, scoped npm packages, and various URL formats with/without trailing slashes.

Fixes #27.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI commented Aug 25, 2025

Copy link
Copy Markdown
Contributor Author

@YDX-2147483647 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs.

I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review.

Copilot AI changed the title [WIP] Update add_project.py Update add_project.py to support new issue form fields (Labels and Package registries) Aug 25, 2025
Copilot AI requested a review from YDX-2147483647 August 25, 2025 11:34
Co-authored-by: YDX-2147483647 <73375426+YDX-2147483647@users.noreply.github.com>
@YDX-2147483647
YDX-2147483647 marked this pull request as ready for review August 25, 2025 15:37
@YDX-2147483647
YDX-2147483647 merged commit e368963 into main Aug 25, 2025
1 check passed
@YDX-2147483647
YDX-2147483647 deleted the copilot/fix-27 branch August 25, 2025 16:15
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.

Update add_project.py

2 participants