Skip to content
This repository was archived by the owner on Jul 19, 2025. It is now read-only.

Use codeclimate-parser backend #207

Merged
merged 3 commits into from
Aug 28, 2017
Merged

Use codeclimate-parser backend #207

merged 3 commits into from
Aug 28, 2017

Conversation

dblandin
Copy link
Contributor

Setup a java channel to pull in our new parser backend. This keeps all of the core language implementation intact and unchanged while we build out java support.

This PR makes the parser available via the base image. A following PR will add the Java support implementation.

@codeclimate-hermes codeclimate-hermes requested review from wfleming and removed request for codeclimate-hermes August 28, 2017 17:18
@codeclimate-hermes codeclimate-hermes requested review from gdiggs and removed request for codeclimate-hermes August 28, 2017 18:48
@dblandin dblandin requested review from codeclimate-hermes and removed request for gdiggs August 28, 2017 18:48
@codeclimate-hermes codeclimate-hermes removed their request for review August 28, 2017 18:49
@codeclimate-hermes codeclimate-hermes requested review from maxjacobson and removed request for codeclimate-hermes August 28, 2017 18:49
Copy link
Contributor

@maxjacobson maxjacobson left a comment

Choose a reason for hiding this comment

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

Just a few small questions. Nice job!

Dockerfile Outdated

RUN bundle install --jobs 4 && \
cd /usr/src/app/vendor/php-parser && composer install --no-interaction && \
npm install
Copy link
Contributor

Choose a reason for hiding this comment

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

is this npm install-ing inside of the php directory?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ahh, good point. I don't think so, but I'm now taking advantage of a composer install flag that sets the working directory, just for the composer dependency installation.

@@ -0,0 +1,13 @@
{
Copy link
Contributor

Choose a reason for hiding this comment

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

What's up with this file? Do we want it? If we do, I think we should COPY it in the dockerfile and document how to update it over time

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm including it for now because npm install outputs a warning when it writes the file. We'll be removing this particular npm install when we move over to the parser soon, so I'm inclined to punt on the documentation. Added that COPY argument though 👍

Dockerfile Outdated
openjdk-8-jdk-headless maven \
php php-common php-cli php-fpm php-xml composer \
python python2.7 python-pip python-setuptools \
ruby2.3 ruby2.3-dev bundler
Copy link
Contributor

Choose a reason for hiding this comment

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

Are some of these things maybe already available via the base image and don't need to be re-installed? I suppose it doesn't hurt to re-install them

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ahhh, yes, most of these are redundant. Cleaned up!

@dblandin dblandin force-pushed the devon/parser-backend branch 3 times, most recently from 56fc7b9 to 56fa20b Compare August 28, 2017 19:32
@dblandin dblandin requested a review from maxjacobson August 28, 2017 19:32
Copy link
Contributor

@maxjacobson maxjacobson left a comment

Choose a reason for hiding this comment

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

Nice job - I was afraid this would be more involved

Dockerfile Outdated
RUN cd /usr/src/app/vendor/php-parser/ && composer install --prefer-source --no-interaction
RUN npm install
RUN bundle install --jobs 4 --quiet && \
composer install --no-interaction --quiet --working-dir /usr/src/app/vendor/php-parser && \
Copy link
Contributor

Choose a reason for hiding this comment

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

working-dir nice

Copy link
Contributor

Choose a reason for hiding this comment

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

these --quiets are nice too, they definitely make the output less noisy

Dockerfile Outdated
@@ -1,73 +1,27 @@
FROM ruby:2.3-alpine
FROM codeclimate/codeclimate-parser:java-beta
Copy link
Contributor

Choose a reason for hiding this comment

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

if our channel release strategy is to make the tag based on the branch name, and not the build number, how do we bump the base image?

This looks correct based on our parser release strategy, but I'm just curious how we're planning to handle that...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a good point. We probably shouldn't be using a java-beta tag for the codeclimate-parser image. I'll make some changes there, so we can use a b### tag here as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the java branch of codeclimate-parser to push b###-tagged images that we can use as the base for this channel: https://circleci.com/gh/codeclimate/codeclimate-parser/264

RUN cd /usr/src/app/vendor/php-parser/ && composer install --prefer-source --no-interaction
RUN npm install
RUN bundle install --jobs 4 --quiet && \
composer install --no-interaction --quiet --working-dir ./vendor/php-parser && \
Copy link
Contributor

Choose a reason for hiding this comment

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

I like these --quiets!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ssshhh

This commit updates the Dockerfile to simplify the installation process
of languages and dependencies, and also brings in the new codeclimate
parser.
@dblandin dblandin force-pushed the devon/parser-backend branch from 56fa20b to 6338b16 Compare August 28, 2017 20:08
@dblandin dblandin merged commit 2a5a07e into channel/java Aug 28, 2017
@dblandin dblandin deleted the devon/parser-backend branch August 28, 2017 20:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants