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

[DOP-4438]: Add component filtering for production builds in the Autobuilder #1025

Merged
merged 11 commits into from
Apr 4, 2024

Conversation

branberry
Copy link
Contributor

@branberry branberry commented Apr 2, 2024

Stories/Links:

DOP-4438

Notes

This PR adds the component factory filter functionality to builds.

successful build

README updates

    • This PR introduces changes that should be reflected in the README, and I have made those updates.
    • This PR does not introduce changes that should be reflected in the README

Copy link

github-actions bot commented Apr 2, 2024

Your feature branch infrastructure has been deployed!

Your webhook URL is: https://46zl6zyuea.execute-api.us-east-2.amazonaws.com/prod/webhook/githubEndpoint/trigger/build

For more information on how to use this endpoint, follow these instructions.

@@ -244,12 +238,6 @@ describe('ProductionJobHandler Tests', () => {
jobHandlerTestHelper.setupForSuccess();
await jobHandlerTestHelper.jobHandler.execute();
jobHandlerTestHelper.verifyNextGenSuccess();

expect(jobHandlerTestHelper.fileSystemServices.writeToFile).toBeCalledWith(
`repos/${jobHandlerTestHelper.job.payload.repoName}/.env.production`,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed this as I believe it's not providing a ton of value, and leads to additional overhead when making changes.

@@ -166,12 +166,6 @@ describe('ProductionJobHandler Tests', () => {
jobHandlerTestHelper.setupForSuccess();
await jobHandlerTestHelper.jobHandler.execute();
jobHandlerTestHelper.verifyNextGenSuccess();
// TODO: Correct number of arguments
expect(jobHandlerTestHelper.fileSystemServices.writeToFile).toBeCalledWith(
`repos/${jobHandlerTestHelper.job.payload.repoName}/.env.production`,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed this as I believe it's not providing a ton of value, and leads to additional overhead when making changes.

# get shared.mk
RUN curl https://raw.githubusercontent.com/mongodb/docs-worker-pool/meta/makefiles/shared.mk -o shared.mk

# install snooty frontend and docs-tools
RUN git clone -b v${SNOOTY_FRONTEND_VERSION} --depth 1 https://github.com/mongodb/snooty.git \
&& cd snooty \
&& npm ci --legacy-peer-deps --omit=dev \
Copy link
Contributor Author

@branberry branberry Apr 4, 2024

Choose a reason for hiding this comment

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

Need to remove omit dev as the filter functionality for the frontend depends on a dev dependency.

Copy link
Contributor

Choose a reason for hiding this comment

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

Wondering why it's a dev dependency then?

Copy link
Contributor

Choose a reason for hiding this comment

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

I had the same question! We should definitely consider moving the relevant dependencies to be installed for prod in the near future if possible

@branberry branberry changed the title [DOP-4438]: Add rust installation [DOP-4438]: Add component filtering for production builds in the Autobuilder Apr 4, 2024
@branberry branberry marked this pull request as ready for review April 4, 2024 17:12
# get shared.mk
RUN curl https://raw.githubusercontent.com/mongodb/docs-worker-pool/meta/makefiles/shared.mk -o shared.mk

# install snooty frontend and docs-tools
RUN git clone -b v${SNOOTY_FRONTEND_VERSION} --depth 1 https://github.com/mongodb/snooty.git \
&& cd snooty \
&& npm ci --legacy-peer-deps --omit=dev \
Copy link
Contributor

Choose a reason for hiding this comment

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

Wondering why it's a dev dependency then?

Comment on lines +404 to +409
// Setting this to always be true. It's one less SSM parameter to manage,
// and it doesn't hurt to always do the filtering. The only reason
// it exists here is so that we don't always filter when testing locally.
// This is because the filter functionality updates the ComponentFactory.js file
// which could be accidentally committed if run locally.
USE_FILTER_BRANCH: true,
Copy link
Contributor

Choose a reason for hiding this comment

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

Will there be an easy way to flip this variable if something goes wrong in prod though? Just wondering on a quick roll-back plan.

Copy link
Contributor

@anabellabuckvar anabellabuckvar left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Contributor

@rayangler rayangler left a comment

Choose a reason for hiding this comment

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

LGTM! Reviewed live with @branberry

@branberry branberry merged commit 24ec3e5 into main Apr 4, 2024
6 checks passed
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