-
Notifications
You must be signed in to change notification settings - Fork 73
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-4020: repos_branches to docsets #909
Merged
Merged
Changes from 24 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
3f27242
find todos in main RepoBranchesRepository, consolidate slack helpers
mmeigs 8d53507
delete unused RepoBranchesRepository method
mmeigs 8216fd2
replace getRepo everywhere with new DocsetsRepository getRepo
mmeigs 2dfc6bd
add docsetsRepository to each JobHandler and test
mmeigs 42b70f0
add docsetsRepo to JobHandlers
mmeigs eeed174
more test finds, missing references
mmeigs 763f2c6
added env vars for docsetCollection
mmeigs 776e30f
modify tests
mmeigs 22b977c
set to stage ecs
mmeigs 5317f13
add docsets to parameter store and serverless
mmeigs f96335d
more env vars
mmeigs 3909513
persistence module repos_branches migrate to docsets
mmeigs 5dbe09f
work on tests in persistence module
mmeigs ea80698
Merge branch 'master' into DOP-4020-docsets
mmeigs 4cf61c0
dont use preprd
mmeigs 8269fe0
fixed persistence tests
mmeigs 0cff1a1
merge two separate docsetsRepos
mmeigs 01200c2
deploy preprd
mmeigs 8352898
use .env
mmeigs e6f8bf4
debug failing test
mmeigs b002f2e
all tests passing
mmeigs 2b3a87a
Merge branch 'master' into DOP-4020-docsets
mmeigs fc45dff
PR feedback
mmeigs e2ca1d4
fix test
mmeigs b59e573
fix v2 to match v1, double query
mmeigs 6d1e6d6
Merge branch 'master' into DOP-4020-docsets
mmeigs 4727b68
add warning to checkSnootyTomlPath
mmeigs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,18 +8,20 @@ import { ConsoleLogger } from '../../../src/services/logger'; | |
import { RepoBranchesRepository } from '../../../src/repositories/repoBranchesRepository'; | ||
import { EnhancedJob, JobStatus } from '../../../src/entities/job'; | ||
import { markBuildArtifactsForDeletion, validateJsonWebhook } from '../../handlers/github'; | ||
import { DocsetsRepository } from '../../../src/repositories/docsetsRepository'; | ||
import { getMonorepoPaths } from '../../../src/monorepo'; | ||
import { getUpdatedFilePaths } from '../../../src/monorepo/utils/path-utils'; | ||
|
||
async function prepGithubPushPayload( | ||
githubEvent: PushEvent, | ||
repoBranchesRepository: RepoBranchesRepository, | ||
docsetsRepository: DocsetsRepository, | ||
prefix: string | ||
): Promise<Omit<EnhancedJob, '_id'>> { | ||
const branch_name = githubEvent.ref.split('/')[2]; | ||
const branch_info = await repoBranchesRepository.getRepoBranchAliases(githubEvent.repository.name, branch_name); | ||
const urlSlug = branch_info.aliasObject?.urlSlug ?? branch_name; | ||
const repo_info = await repoBranchesRepository.getRepo(githubEvent.repository.name); | ||
const repo_info = await docsetsRepository.getRepo(githubEvent.repository.name); | ||
const project = repo_info?.project ?? githubEvent.repository.name; | ||
|
||
return { | ||
|
@@ -58,6 +60,7 @@ export const TriggerBuild = async (event: APIGatewayEvent): Promise<APIGatewayPr | |
const consoleLogger = new ConsoleLogger(); | ||
const jobRepository = new JobRepository(db, c, consoleLogger); | ||
const repoBranchesRepository = new RepoBranchesRepository(db, c, consoleLogger); | ||
const docsetsRepository = new DocsetsRepository(db, c, consoleLogger); | ||
|
||
if (!event.body) { | ||
const err = 'Trigger build does not have a body in event payload'; | ||
|
@@ -98,10 +101,10 @@ export const TriggerBuild = async (event: APIGatewayEvent): Promise<APIGatewayPr | |
} | ||
|
||
const env = c.get<string>('env'); | ||
const repoInfo = await repoBranchesRepository.getRepo(body.repository.name); | ||
const repoInfo = await docsetsRepository.getRepo(body.repository.name); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. one more time here for double fetching There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed! tysm |
||
const jobPrefix = repoInfo?.prefix ? repoInfo['prefix'][env] : ''; | ||
|
||
const job = await prepGithubPushPayload(body, repoBranchesRepository, jobPrefix); | ||
const job = await prepGithubPushPayload(body, repoBranchesRepository, docsetsRepository, jobPrefix); | ||
|
||
if (process.env.MONOREPO_PATH_FEATURE === 'true') { | ||
try { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Realized these functions were identical and duplicated between v1 and v2. Rolled them out to a handlers file same as others we've done in the past month.