Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: relax hard-coded version check for git #1211

Merged
merged 1 commit into from
Sep 17, 2024

Conversation

MikeMcC399
Copy link
Collaborator

@MikeMcC399 MikeMcC399 commented Sep 17, 2024

Issue

CircleCI contains a check for a fixed version of git, however this version is not under control of the factory build process. This causes unplanned workflow failures when new versions of git are released.

This is the hard-coded check:

- run:
name: check git version
command: |
ACTUAL_VERSION=$(docker compose run test-factory-all-included git --version)
if [ "git version 2.39.2" != "${ACTUAL_VERSION}" ]; then
echo "Version mismatch, git package version: git version 2.39.2 != ${ACTUAL_VERSION}"
exit 1;
fi
echo "Version ${ACTUAL_VERSION} confirmed"
working_directory: factory/test-project

The version of git depends on the BASE_IMAGE:

BASE_IMAGE='debian:12.7-slim'

and so far this is a Debian image, it depends also on the currently distributed package version according to Package git which is picked up by the build process:

&& apt-get update \
&& apt-get install --no-install-recommends -y \

causing a refresh each time the cypress/factory image is rebuilt. This is what breaks the workflow job check-factory-versions from time to time.

Change

Remove the check for a specific version of git and report the version of git found.

This method is already used in the ssh check in the workflow lines of code following the git version check.

@cypress-app-bot
Copy link

@MikeMcC399
Copy link
Collaborator Author

Copy link
Member

@jennifer-shehane jennifer-shehane left a comment

Choose a reason for hiding this comment

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

We can relax the exact version match check, but we do need to exit the process if NO version of git exists to ensure we don’t release an image that does not have git installed, which happened before here: #874

Can you update the check to exit if a git version is not found at all?

@MikeMcC399
Copy link
Collaborator Author

MikeMcC399 commented Sep 17, 2024

@jennifer-shehane

We can relax the exact version match check, but we do need to exit the process if NO version of git exists to ensure we don’t release an image that does not have git installed, which happened before here: #874

Can you update the check to exit if a git version is not found at all?

image

The logic is the same as for ssh which follows in the workflow.

@jennifer-shehane jennifer-shehane merged commit 3ec6eaf into cypress-io:master Sep 17, 2024
33 checks passed
@MikeMcC399 MikeMcC399 deleted the check-git-version branch September 18, 2024 05:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants