-
Notifications
You must be signed in to change notification settings - Fork 66
feat: Add migration for existing project #1424
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
Merged
Changes from 69 commits
Commits
Show all changes
75 commits
Select commit
Hold shift + click to select a range
193c571
wip
joe-yeager 307a833
wip
joe-yeager 2d96fbb
Fake it
joe-yeager 503b2c8
wip
joe-yeager 99f343e
Refactor
joe-yeager b9e1611
Add additional reasons
joe-yeager 175e36c
Review copy with Jono
joe-yeager e7350b4
test
joe-yeager 0d20207
Integration tweaks
joe-yeager 143ad49
v7.2.3-experimental.0
joe-yeager ac26a4b
Add logs displaying what will be migrated, prompt to proceed
joe-yeager 009fe74
Remove duplicate tracking event, add shell for hs project migrate
joe-yeager 84013dd
Merge branch 'main' of github.com:HubSpot/hubspot-cli into jy/migrati…
joe-yeager 3f556b3
Clean up
joe-yeager 78cb580
Clean up, add tests
joe-yeager 79ee7c8
Implement polling
joe-yeager e4bee05
Add the bones for hs project migrate
joe-yeager 54ca912
Merge branch 'main' of github.com:HubSpot/hubspot-cli into jy/migrati…
joe-yeager 80e3001
Udpate after LDL release
joe-yeager 87fd9d5
Add defaultAnswer for dest
joe-yeager 39393cf
clean up
joe-yeager 505df3d
Update LDL version
joe-yeager bbbed83
Fix wierd flag behavior
joe-yeager 4907c78
Remove async and promise wrapper
joe-yeager 8bb55a6
Merge branch 'main' of github.com:HubSpot/hubspot-cli into jy/migrati…
joe-yeager bfafd18
Feedback
joe-yeager 9ce5273
feedback
joe-yeager 3ac138b
Merge branch 'jy/migration-v2' of github.com:HubSpot/hubspot-cli into…
joe-yeager 8d3af4f
Refactor, add more of the flow
joe-yeager 8321037
wip
joe-yeager adfcc01
Get it working with new endpoints
joe-yeager 91b557e
Use experimental release
joe-yeager cd6fe01
Remove console.logs
joe-yeager 1e5b7c0
Merge branch 'main' of github.com:HubSpot/hubspot-cli into jy/migrati…
joe-yeager 2fcbaa9
Fixes
joe-yeager d1b3243
Undo
joe-yeager 110baf1
Inline i18nkey
joe-yeager 2a11251
Merge branch 'jy/migration-v2' of github.com:HubSpot/hubspot-cli into…
joe-yeager 210cb5f
clean up
joe-yeager 223f554
PR feedback, move stuff around, add API calls to CLI
joe-yeager 6daa0df
Fix bad import
joe-yeager 8ac0831
Remove migration spinner
joe-yeager 6bff187
Merge branch 'main' of github.com:HubSpot/hubspot-cli into jy/migrati…
joe-yeager 9d60f24
Feedback from demo
joe-yeager 04e54f6
fix bug with filtering apps
joe-yeager 7a8f442
Merge branch 'jy/migration-v2' of github.com:HubSpot/hubspot-cli into…
joe-yeager eb40310
Changes after merge
joe-yeager e2d634c
Merge branch 'main' of github.com:HubSpot/hubspot-cli into jy/migrati…
joe-yeager 61831b7
Merge branch 'jy/migration-v2' of github.com:HubSpot/hubspot-cli into…
joe-yeager 7266130
fix existing tests
joe-yeager e645adb
wip
joe-yeager 4c0996b
fix test
joe-yeager 9c02037
Hide zip extraction logs
joe-yeager d538391
Merge branch 'jy/migration-v2' of github.com:HubSpot/hubspot-cli into…
joe-yeager 25542fc
Merge branch 'main' of github.com:HubSpot/hubspot-cli into jy/migrate…
joe-yeager 3dd7e93
Update copy
joe-yeager f0c5f3d
Tweaks after integration with BE.
joe-yeager 2138f4c
Merge branch 'main' of github.com:HubSpot/hubspot-cli into jy/migrate…
joe-yeager 309c64f
fix bugs with migration flow
joe-yeager b0591ee
Use en.js
joe-yeager e0e8123
Fix lang file errors, fix bug when not ran in project
joe-yeager 0ed6cc3
Merge branch 'main' of github.com:HubSpot/hubspot-cli into jy/migrate…
joe-yeager 7aa2be2
Merge branch 'main' of github.com:HubSpot/hubspot-cli into jy/migrate…
joe-yeager ed0586f
Merge branch 'main' of github.com:HubSpot/hubspot-cli into jy/migrate…
joe-yeager bae540f
Move types to command files
joe-yeager 5f9a4fb
Add platform-version flag, default to 2025.2
joe-yeager 0e14601
Add platform version flag that defaults to 2025.2 and fix a bug when …
joe-yeager 170693b
Merge branch 'main' of github.com:HubSpot/hubspot-cli into jy/migrate…
joe-yeager 153ad7e
PR feedback
joe-yeager 037aa18
PR feedback
joe-yeager 4176b02
Send platformVersion in list apps
joe-yeager 6bd9bc3
Add debug logs
joe-yeager 910b81f
Update test
joe-yeager f5a8e72
convert query param to enum format, update test
joe-yeager 56e2aa7
Merge branch 'main' of github.com:HubSpot/hubspot-cli into jy/migrate…
joe-yeager 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
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
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
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,84 @@ | ||
import { i18n } from '../../lib/lang'; | ||
|
||
import { ArgumentsCamelCase, Argv, CommandModule } from 'yargs'; | ||
import { logger } from '@hubspot/local-dev-lib/logger'; | ||
import { | ||
AccountArgs, | ||
CommonArgs, | ||
ConfigArgs, | ||
EnvironmentArgs, | ||
} from '../../types/Yargs'; | ||
import { | ||
addAccountOptions, | ||
addConfigOptions, | ||
addGlobalOptions, | ||
} from '../../lib/commonOpts'; | ||
import { migrateApp2025_2 } from '../../lib/app/migrate'; | ||
import { getProjectConfig } from '../../lib/projects'; | ||
import { PLATFORM_VERSIONS } from '@hubspot/local-dev-lib/constants/projects'; | ||
import { logError } from '../../lib/errorHandlers'; | ||
import { EXIT_CODES } from '../../lib/enums/exitCodes'; | ||
|
||
export type ProjectMigrateArgs = CommonArgs & | ||
AccountArgs & | ||
EnvironmentArgs & | ||
ConfigArgs & { | ||
platformVersion: string; | ||
}; | ||
|
||
export const command = 'migrate'; | ||
|
||
export const describe = undefined; // i18n('commands.project.subcommands.migrate.noProjectConfig') | ||
|
||
export async function handler( | ||
options: ArgumentsCamelCase<ProjectMigrateArgs> | ||
): Promise<void> { | ||
const projectConfig = await getProjectConfig(); | ||
|
||
if (!projectConfig.projectConfig) { | ||
logger.error( | ||
i18n('commands.project.subcommands.migrate.errors.noProjectConfig') | ||
); | ||
return process.exit(EXIT_CODES.ERROR); | ||
} | ||
|
||
const { derivedAccountId } = options; | ||
try { | ||
await migrateApp2025_2( | ||
derivedAccountId, | ||
{ | ||
...options, | ||
name: projectConfig?.projectConfig?.name, | ||
platformVersion: options.platformVersion, | ||
}, | ||
projectConfig | ||
); | ||
} catch (error) { | ||
logError(error); | ||
return process.exit(EXIT_CODES.ERROR); | ||
} | ||
return process.exit(EXIT_CODES.SUCCESS); | ||
} | ||
|
||
export function builder(yargs: Argv): Argv<ProjectMigrateArgs> { | ||
addConfigOptions(yargs); | ||
addAccountOptions(yargs); | ||
addGlobalOptions(yargs); | ||
|
||
yargs.option('platform-version', { | ||
type: 'string', | ||
choices: Object.values(PLATFORM_VERSIONS), | ||
default: PLATFORM_VERSIONS.v2025_2, | ||
hidden: true, | ||
}); | ||
|
||
return yargs as Argv<ProjectMigrateArgs>; | ||
} | ||
const migrateAppCommand: CommandModule<unknown, ProjectMigrateArgs> = { | ||
command, | ||
describe, | ||
handler, | ||
builder, | ||
}; | ||
|
||
export default migrateAppCommand; |
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
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.
Uh oh!
There was an error while loading. Please reload this page.