-
Notifications
You must be signed in to change notification settings - Fork 729
Organization merge suggestion improvements #1649
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
Merged
epipav
merged 10 commits into
main
from
improvement/organization-merge-suggestions-scripts
Oct 10, 2023
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
280a61c
better pagination in org merge suggestions, convenience script, few e…
epipav bcaab8c
Merge branch 'main' into improvement/organization-merge-suggestions-s…
epipav 71c7cf6
formatting
epipav 24ed296
Merge branch 'improvement/organization-merge-suggestions-scripts' of …
epipav 4349b02
log calls updated
epipav 5f94023
merge suggestion worker now first processes org merge suggestions, co…
epipav 9406e37
Merge branch 'main' into improvement/organization-merge-suggestions-s…
epipav a005265
discard empty identities when generating org merge suggestions, loggi…
epipav bce35e3
linting
epipav 31112c6
sorting organization merge suggestions using similarity desc
epipav 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 hidden or 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 |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import commandLineArgs from 'command-line-args' | ||
import commandLineUsage from 'command-line-usage' | ||
import * as fs from 'fs' | ||
import path from 'path' | ||
import { mergeSuggestionsWorker } from '@/serverless/microservices/nodejs/merge-suggestions/mergeSuggestionsWorker' | ||
|
||
/* eslint-disable no-console */ | ||
|
||
const banner = fs.readFileSync(path.join(__dirname, 'banner.txt'), 'utf8') | ||
|
||
const options = [ | ||
{ | ||
name: 'tenant', | ||
alias: 't', | ||
type: String, | ||
description: | ||
'The unique ID of that tenant that you would like to generate merge suggestions for.', | ||
}, | ||
{ | ||
name: 'help', | ||
alias: 'h', | ||
type: Boolean, | ||
description: 'Print this usage guide.', | ||
}, | ||
] | ||
const sections = [ | ||
{ | ||
content: banner, | ||
raw: true, | ||
}, | ||
{ | ||
header: 'Generate merge suggestions for a tenant', | ||
content: 'Generate merge suggestions for a tenant', | ||
}, | ||
{ | ||
header: 'Options', | ||
optionList: options, | ||
}, | ||
] | ||
|
||
const usage = commandLineUsage(sections) | ||
const parameters = commandLineArgs(options) | ||
|
||
if (parameters.help || !parameters.tenant) { | ||
console.log(usage) | ||
} else { | ||
setImmediate(async () => { | ||
const tenantIds = parameters.tenant.split(',') | ||
|
||
for (const tenantId of tenantIds) { | ||
await mergeSuggestionsWorker(tenantId) | ||
} | ||
process.exit(0) | ||
}) | ||
} |
This file contains hidden or 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 hidden or 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 hidden or 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
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.
Uh oh!
There was an error while loading. Please reload this page.