fix(ci): fix release workflow #482
Reference in New Issue
Block a user
Delete Branch "fix/ci-release"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Decision: Reject
Change Score: 45%
This change introduces several issues and unnecessary complexity. The removal of the manual trigger, while perhaps intended to streamline the process, eliminates a valuable option for on-demand releases. The shift to using separate workflows for tagging and release creation adds unnecessary complexity. The logic for determining changes since the last tag is completely removed, and the approach to getting the release ID seems convoluted and fragile. The Docker build process also undergoes significant changes, with questionable modifications to Docker configuration and image tagging.
Here's a breakdown of the problems and suggestions:
Loss of Manual Trigger Functionality: The removal of the
issue_commenttrigger removes the ability to manually trigger a release. This is a significant regression.Complicated Workflow Structure: The introduction of separate workflows (
release-with-tag.yaml,create-release-preexisting-tag.yaml) increases complexity. The original approach was more self-contained.Fragile Release ID Retrieval: The method for retrieving the release ID using
curlandjqis prone to errors if the API format changes. This is brittle.Questionable Docker Configuration Changes: Modifying
/etc/default/dockerand/etc/docker/daemon.jsonto enable insecure registries is a security risk and should be carefully considered.Inconsistent Tagging and Referencing: The changes introduce inconsistencies in how tags are handled and referenced throughout the workflow. For example,
needs.tag.outputs.tag_nameis used in some places, whileneeds.create_release.outputs.release_namewas used previously.Removal of Change Detection: The original workflow included a mechanism to detect if there were any changes since the last tag and cancel the release if there weren't. This prevents unnecessary releases. This is completely removed.
Missing Docker Hub Login: The removal of the Docker Hub login step raises concerns about the Docker image publishing process. If Docker Hub is still used, this step is essential.
Hardcoded workflow path: The
Testjob is commented out, but points to a hardcoded path. The path should use${{ gitea.repository }}or be removed.Here's a revised version of the workflow that addresses some of these issues (though a full refactor might be needed based on the specific requirements):
Key changes in the revised version:
needs.create_release.outputs.tagfor referencing the tag name.create_dockertocreate_release.This revised version is still not perfect, but it addresses some of the most critical issues in the original diff. Re-introducing change detection and thoroughly testing the Docker image building and publishing process are crucial next steps. Also the use of the
release-with-tag.yamlandcreate-release-preexisting-tag.yamlneeds to be justified. If those can be merged, that will greatly improve the simplicity of this solution.