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

feature: print version on the start of execution and always pull docker image (always update stable) #417

Closed
wants to merge 1 commit into from

Conversation

pedrocodacy
Copy link
Contributor

did this one on the side while fixing tests in worker

I havent tested it yet, but its ready for review of the approach (actually I tested that the env of the docker contains the version, so further testing should be a quick thing)

@pedrocodacy pedrocodacy force-pushed the feature/add-version-text-output branch from 8f0550a to 8413adf Compare August 18, 2021 14:36
project/Common.scala Outdated Show resolved Hide resolved
@pedrocodacy pedrocodacy force-pushed the feature/add-version-text-output branch 3 times, most recently from 7f415f9 to 9fa75eb Compare August 23, 2021 16:17
@pedrocodacy pedrocodacy changed the title feature: print version on the start of Text output feature: print version on the start of execution and always pull docker image (always update stable) Aug 23, 2021
cli/src/main/scala/com/codacy/analysis/cli/Main.scala Outdated Show resolved Hide resolved
project/Common.scala Outdated Show resolved Hide resolved
@pedrocodacy pedrocodacy force-pushed the feature/add-version-text-output branch 2 times, most recently from e8fce90 to 45bb1b7 Compare August 23, 2021 17:09
@pedrocodacy pedrocodacy force-pushed the feature/add-version-text-output branch 2 times, most recently from e1cfdaf to cd3eb1f Compare August 10, 2022 18:02
@pedrocodacy pedrocodacy force-pushed the feature/add-version-text-output branch 2 times, most recently from b3d7412 to 2e323bf Compare August 12, 2022 10:02
@pedrocodacy pedrocodacy force-pushed the feature/add-version-text-output branch from 2e323bf to a140329 Compare August 12, 2022 10:10
@pedrocodacy
Copy link
Contributor Author

still needs some testing locally

Copy link
Contributor

@vascorsd vascorsd left a comment

Choose a reason for hiding this comment

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

The code itself seems ok, it compile and I verified that locally passing: "set codacyAnalysisCli / version := "magic version" and doing compile and then "codacyAnalysisCli / run --version", seems to all be working.

The script itself I already left comments inline.

The only issue I'm not sure is if this will really change the version for the released binary, as is I believe it stays the same, since looking at the circle ci file I only see one single place changing the version with sbt. It has the following at line 178 - sbt "set codacyAnalysisCli / version := \"dev-snapshot\";, so please confirm if this also needs to change.

If that verification comes afterwards or the change itself, we can still approve and go on with the PR as is.

@@ -31,6 +31,7 @@ run() {
output_volume="--volume ${OUTPUT_DIRECTORY}:${OUTPUT_DIRECTORY}";
fi
local CODACY_ANALYSIS_CLI_VERSION="${CODACY_ANALYSIS_CLI_VERSION:-stable}"
docker pull codacy/codacy-analysis-cli:${CODACY_ANALYSIS_CLI_VERSION}
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems to work as I tried locally with the changed script to fetch a latest stable version or other version.

I'd reccomened the change that machado said to add quotes, I tried with things like env CODACY_ANALYSIS_CLI_VERSION="stuff stuff" and it really gets a little better UX with the quotes.

Also It seems better to have the commands connected with a &&, I just checked locally and seems to behave better in case of a bad tag passed since it doesn't try to run something invalid after already tried to pull something invalid and failling. So:

Suggested change
docker pull codacy/codacy-analysis-cli:${CODACY_ANALYSIS_CLI_VERSION}
docker pull codacy/codacy-analysis-cli:"${CODACY_ANALYSIS_CLI_VERSION}" &&

Copy link
Contributor

Choose a reason for hiding this comment

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

Also bellow on line 45:

codacy/codacy-analysis-cli:${CODACY_ANALYSIS_CLI_VERSION} should be codacy/codacy-analysis-cli:"${CODACY_ANALYSIS_CLI_VERSION}"

So it's consistent.

@pedrocodacy
Copy link
Contributor Author

closing since this is stale, we can consider having these changes later

@pedrocodacy pedrocodacy closed this Nov 6, 2023
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.

4 participants