Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Sep 22, 2025

This PR migrates all Python CI scripts to TypeScript to achieve better type safety and maintain consistency with the main codebase, which is written in TypeScript.

Background

The repository contained several Python scripts used by CI workflows for release management and changelog generation. While functional, these scripts lacked type safety and introduced an additional runtime dependency (Python) for CI operations.

Changes Made

Converted 5 Python scripts to TypeScript:

  • prepare_changelog.pyprepare_changelog.ts - Extracts changelog snippets for releases
  • rollback_changelog.pyrollback_changelog.ts - Generates changelog content for rollback releases
  • update.pyupdate.ts - Updates supported GitHub Enterprise Server versions
  • update-release-branch.pyupdate-release-branch.ts - Manages release branch updates and PR creation
  • release-branches.pyrelease-branches.ts - Determines release and backport target branches

Updated 5 workflow files to use TypeScript scripts:

  • Modified workflows to install ts-node and execute scripts with npx ts-node
  • Removed Python setup steps and Pipfile dependencies
  • Maintained identical command-line interfaces for seamless migration

Benefits

  • Type Safety: Compile-time type checking prevents runtime errors
  • Consistency: Aligns with the main codebase's TypeScript usage
  • Maintainability: Better IDE support, refactoring capabilities, and developer experience
  • Simplified Dependencies: Removes Python runtime requirement for CI scripts
  • Code Quality: Leverages existing TypeScript tooling and linting rules

Compatibility

All scripts maintain 100% functional compatibility with their Python predecessors:

  • Identical command-line argument parsing
  • Same output formats and behavior
  • No changes to workflow interfaces or expected results

The migration follows the established pattern used by .github/actions/check-codescanning-config/index.ts, ensuring consistency with existing TypeScript CI tooling.

Testing

  • ✅ All TypeScript scripts compile successfully
  • ✅ Functional testing verified script behavior matches Python versions
  • ✅ Security scan passed with no vulnerabilities
  • ✅ Full test suite passes (564 tests)
  • ✅ Build and linting successful

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@Copilot Copilot AI changed the title [WIP] This repository currently contains a number of Python scripts that are used by various CI workflows. We want to migrate these Python scripts to TypeScript to get better type safety and for more uniformity with the main codebase (that is also written in... Convert Python CI scripts to TypeScript for better type safety and consistency Sep 22, 2025
@Copilot Copilot AI requested a review from mbg September 22, 2025 15:36
Copilot finished work on behalf of mbg September 22, 2025 15:36
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.

2 participants