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-3911]: Check project path for monorepo #894

Merged
merged 32 commits into from
Sep 7, 2023
Merged

[DOP-3911]: Check project path for monorepo #894

merged 32 commits into from
Sep 7, 2023

Conversation

branberry
Copy link
Contributor

@branberry branberry commented Aug 24, 2023

Ticket

DOP-3911

Description

Adds logic to find the project's path within the monorepo based on given file changes. This change supports detecting nested projects as well.

This PR also includes the functionality to check whether or not the project paths detected from GitHub match what is configured within the corresponding docset entry.

This PR also includes small bugfixes/improvements:

  • fixed bug when updating the webhooks for a feature branch
  • added the creating of a parameter store parameter within the CDK for the feature flag

Testing

  1. Create a fork of the docs-monorepo repository
  2. follow the instructions for configuring the webhook here with the following modifications: Use the following webhook URL: https://3kxa3rkxf8.execute-api.us-east-2.amazonaws.com/prod/webhook/githubEndpoint/trigger/build and the secret for pre-prod GitHub push jobs found on Parameter Store.
  3. Make a pull request with an arbitrary change on the forked repo under the docs-landing directory
  4. Verify that the correct repo path is found by checking the CloudWatch log for the lambda
    image

NOTE: You will receive an error message stating that the build has failed. This is due to the autobuilder not having permission to clone the docs-monorepo repository.

@branberry branberry closed this Aug 28, 2023
@branberry branberry reopened this Aug 28, 2023
@@ -46,7 +46,7 @@ jobs:
cd cdk-infra/
npm ci
npm run deploy:feature:stack -- -c env=stg -c customFeatureName=enhancedApp-stg-${{github.head_ref}} \
auto-builder-stack-enhancedApp-stg-${{github.head_ref}}-webhook
auto-builder-stack-enhancedApp-stg-${{github.head_ref}}-webhooks
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixes bug with feature branch update.


const docSetCollectionName = process.env.DOCS_SET_COLLECTION_NAME || 'docset';

export class DocSetRepository extends BaseRepository {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Currently not used since the docset collection in Atlas is not yet configured, but we will need this functionality in the future.


// TODO: Populate these more. For DOP-3911, they are
// being added for testing purposes.
export interface DocSetEntry {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Currently incomplete, but this contains some of the type information that will be needed for the docset collection once it is created.

@branberry branberry changed the title [DOP-3911]: Add way to check file changes and determine what projects… [DOP-3911]: Check project path for monorepo Sep 6, 2023
@branberry branberry marked this pull request as ready for review September 6, 2023 15:33
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! I like the test cases provided

expect(paths).toContain('server-docs/source/datalake');
});

it('Returns an empty array if there is no snooty.toml at in point in the file path', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

at in point in the file path

Should this be "at any point" ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope! It should be in point, lol jk!! good catch, I'll update that 👍

@branberry branberry merged commit ce592fc into master Sep 7, 2023
7 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.

2 participants