Skip to content

CI: Add workflow to manage modules list#120

Draft
Copilot wants to merge 6 commits intomasterfrom
copilot/create-workflow-add-agency
Draft

CI: Add workflow to manage modules list#120
Copilot wants to merge 6 commits intomasterfrom
copilot/create-workflow-add-agency

Conversation

Copy link
Contributor

Copilot AI commented Feb 23, 2026

  • Create GitHub Actions workflow mt-update-modules.yml for adding/updating modules
  • Define workflow inputs (name, name_fr, location, targetTypeId, color, lat, lng, pkg)
  • Change targetTypeId to number type with type descriptions
  • Implement script to add/update module in modules.json using jq (maintain alphabetical order by name)
  • Implement script to bump module_db_version in modules_values.xml
  • Configure git branch creation with unique naming (using pkg suffix)
  • Set up PR creation with proper title and description
  • Add error handling for version extraction and update validation
  • Fix PR edit command to include branch reference
  • Use more specific grep pattern for robust XML parsing
  • Add explicit permissions for security best practices
  • Validate workflow with comprehensive tests (add, update, sorting, error handling)
  • Run security check (all issues resolved)
Original prompt

This section details on the original issue you should resolve

<issue_title>CI: create a new workflow to add a new agency to the modules list</issue_title>
<issue_description>Modules list: app-android/src/main/res/raw/modules.json
DB version: app-android/src/main/res/values/modules_values.xml

Create a CI with all the proper inputs to add a new elements to the list of modules.
name_fr should be optional but other fields should be required.

Keep a-z order by name field.

Use jq to read JSON file.

Bump module_db_version from XML file to ensure new JSON value will be loaded inside the app.

Create a PR with the change.

git branch name must but unique for this change as this workflow could generate multiple PRs side by side for different agency
Could use the last part of pkg when splitting with . like ${MT_BRANCH_NAME}_update_modules_cc_city_agency_type for pkg=org.mtransit.android.cc_city_agency_type

If it's not too big of an additional effort, support updating existing modules by using same pkg as ID.</issue_description>

Comments on the Issue (you are @copilot in this section)


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Copilot AI and others added 4 commits February 23, 2026 20:49
Co-authored-by: mmathieum <177998+mmathieum@users.noreply.github.com>
Co-authored-by: mmathieum <177998+mmathieum@users.noreply.github.com>
Co-authored-by: mmathieum <177998+mmathieum@users.noreply.github.com>
Co-authored-by: mmathieum <177998+mmathieum@users.noreply.github.com>
Copilot AI changed the title [WIP] Add CI workflow to create new agency in modules list CI: Add workflow to manage modules list Feb 23, 2026
Copilot AI requested a review from mmathieum February 23, 2026 20:59
Comment on lines +19 to +22
targetTypeId:
description: 'Target Type ID'
required: true
type: string
Copy link
Member

Choose a reason for hiding this comment

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

@copilot can targetTypeId be a number or integer?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, changed to number type in commit b3240c6. The workflow validates it as a number input, and it's automatically converted to string when passed to jq for JSON storage (which stores it as "3", "100", etc.). Also added descriptions for the type IDs.

Co-authored-by: mmathieum <177998+mmathieum@users.noreply.github.com>
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.

CI: create a new workflow to add a new agency to the modules list

2 participants