Skip to content

Conversation

Copilot
Copy link

@Copilot Copilot AI commented Sep 26, 2025

Problem

Currently, deploying specific versions of WikiGDrive to production requires resetting the master branch to the target commit, creating releases from that reset state, and then resetting master back. This process is:

  • Risky: Force-pushing to master can cause issues for other developers
  • Cumbersome: Requires manual git operations and coordination
  • Error-prone: Easy to accidentally lose commits or create inconsistent state

Solution

This PR implements a release-based deployment control system that allows deploying any commit, tag, or branch without touching the master branch.

How it works

When creating a GitHub release, you can now specify which version to deploy by adding a deployment target in the release description:

deploy-target: v2.15.14

The production deployment workflow will:

  1. Parse the release description for deployment targets
  2. Checkout the specified commit/tag/branch
  3. Build and deploy that specific version
  4. Fall back to current commit behavior if no target is specified

Supported deployment targets

  • Tags: deploy-target: v2.15.14 (for rollbacks)
  • Commits: deploy-target: a1b2c3d4e5f6 (for specific tested builds)
  • Branches: deploy-target: hotfix/security-patch (for emergency fixes)

Key benefits

  • Safe rollbacks: Deploy any previous version instantly without master branch operations
  • Hotfix flexibility: Deploy critical fixes from feature branches without waiting for merge cycles
  • Testing capability: Deploy specific commits for production testing
  • Full audit trail: All deployments tracked through GitHub releases
  • Backward compatible: Existing release process continues to work unchanged

Example usage

Rollback scenario:

Release Title: Rollback to v2.15.14
Release Description:
deploy-target: v2.15.14

Rolling back production due to critical issues in v2.15.15.

Emergency hotfix:

Release Title: Emergency Security Patch  
Release Description:
deploy-target: hotfix/security-cve-2024-001

Deploying immediate fix for security vulnerability.

Implementation details

  • Modified .github/workflows/prod-server-deploy.yml to support deployment target parsing
  • Added robust validation with fallback to current behavior for invalid targets
  • Case-insensitive matching for flexibility (Deploy-Target: works the same as deploy-target:)
  • Comprehensive documentation with practical examples
  • Test suite to validate parsing logic

This change eliminates the need for risky master branch resets while providing more flexible and safer deployment options for the team.

Original prompt

This section details on the original issue you should resolve

<issue_title>Release-based Deployment Control</issue_title>
<issue_description>Currently, deploying specific versions of the code requires resetting master (or main branch) to the target commit. This is risky and cumbersome. It would be very useful to have a mechanism to control which code version is deployed via the release system itself, without the need to modify or reset master.

Benefits:
Makes rollback to a previous release straightforward.
Improves deployment flexibility, especially for hotfixes or testing older releases.

</issue_description>

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

Fixes #595

💡 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.

Copy link

Please set a versioning label of either major, minor, or patch to the pull request.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@Copilot Copilot AI changed the title [WIP] Release-based Deployment Control Implement release-based deployment control to eliminate master branch resets Sep 26, 2025
@Copilot Copilot AI requested a review from pierzchala-m September 26, 2025 16:54
Copilot finished work on behalf of pierzchala-m September 26, 2025 16:54
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.

Release-based Deployment Control
2 participants