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

feat: detect "old" bots and migrate them to new runtime #6526

Merged
merged 77 commits into from
May 6, 2021
Merged
Show file tree
Hide file tree
Changes from 40 commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
d68993e
introduce a migration system for updating legacy projcts to the 2.0 r…
benbrown Mar 23, 2021
460453c
updated
benbrown Mar 23, 2021
a5c8bfc
ensure root dialog gets updated appropriately
benbrown Mar 23, 2021
000b342
adjust method for updating root dialog
benbrown Mar 23, 2021
4f9808e
remove comments
benbrown Mar 23, 2021
024868d
fire migration warning when loading bot
benbrown Mar 23, 2021
b27254e
use original project name for new project
benbrown Mar 23, 2021
7843021
close modal on submit
benbrown Mar 24, 2021
b8addeb
Merge branch 'main' into benbrown/migrate
benbrown Mar 24, 2021
7e26b4a
Merge branch 'main' into benbrown/migrate
benbrown Mar 29, 2021
3658147
address feedback
benbrown Mar 31, 2021
1a9cb5a
Merge branch 'main' of https://github.com/microsoft/BotFramework-Comp…
benbrown Mar 31, 2021
47fae76
add confirm modal
benbrown Mar 31, 2021
fe8b9b2
Merge branch 'main' into benbrown/migrate
benbrown Apr 5, 2021
bb59d34
Rename azureFunctionsPublish publish targets to azurePublish (new sha…
benbrown Apr 5, 2021
68dc4fc
Merge branch 'main' of https://github.com/microsoft/BotFramework-Comp…
benbrown Apr 7, 2021
b5abb69
Delete a.en-us.lu
benbrown Apr 7, 2021
2479d54
Delete a.en-us.qna
benbrown Apr 7, 2021
e8169cc
Delete b.en-us.lu
benbrown Apr 7, 2021
d9e71f5
Delete b.en-us.qna
benbrown Apr 7, 2021
093811e
Delete bot1.en-us.lu
benbrown Apr 7, 2021
f5a89e0
Delete bot1.en-us.qna
benbrown Apr 7, 2021
f600dd6
do not require pva to migrate
benbrown Apr 7, 2021
d3f4e9e
Merge branch 'benbrown/migrate' of https://github.com/microsoft/BotFr…
benbrown Apr 7, 2021
414b47c
Add missing parameters
benbrown Apr 7, 2021
f187daf
Merge branch 'main' into benbrown/migrate
benbrown Apr 7, 2021
42540e5
Merge branch 'main' into benbrown/migrate
benbrown Apr 7, 2021
db140f0
clarify types
benbrown Apr 7, 2021
11dbdb2
Merge branch 'benbrown/migrate' of https://github.com/microsoft/BotFr…
benbrown Apr 7, 2021
f3d0ced
Merge branch 'main' into benbrown/migrate
benbrown Apr 7, 2021
9bf1a4f
Merge branch 'main' into benbrown/migrate
benbrown Apr 8, 2021
2d0b8ad
Merge branch 'main' into benbrown/migrate
benbrown Apr 8, 2021
e347d8a
Fix tests
benbrown Apr 8, 2021
1cf91c1
Merge branch 'main' into benbrown/migrate
benbrown Apr 8, 2021
37294ae
Fixes #6844: migrate appinsights key to new location
benbrown Apr 13, 2021
b64606f
Merge branch 'main' into benbrown/migrate
boydc2014 Apr 19, 2021
f8a6765
fix migrate lint issue
lei9444 Apr 19, 2021
962d5de
Merge branch 'main' into benbrown/migrate
zhixzhan Apr 20, 2021
9a64f2b
Merge branch 'main' into benbrown/migrate
benbrown Apr 20, 2021
75b562b
Merge branch 'main' into benbrown/migrate
boydc2014 Apr 21, 2021
92ae67f
plumb through the yeomanOptions parameter, required to set the locati…
benbrown Apr 22, 2021
6284c35
Merge branch 'main' of https://github.com/microsoft/BotFramework-Comp…
benbrown Apr 22, 2021
a4c1ff1
feat: new validation pipeline - schema existence validation (#7001)
yeze322 Apr 23, 2021
efb2418
Merge branch 'main' into benbrown/migrate
cwhitten Apr 23, 2021
ae55b50
Merge branch 'main' into benbrown/migrate
cwhitten Apr 23, 2021
66751eb
Merge branch 'main' into benbrown/migrate
cwhitten Apr 25, 2021
00deeef
Merge branch 'main' into benbrown/migrate
benbrown Apr 26, 2021
4aef551
Merge branch 'main' into benbrown/migrate
cwhitten Apr 26, 2021
000eca2
Merge branch 'main' into benbrown/migrate
cwhitten Apr 27, 2021
541c45c
Merge branch 'main' of https://github.com/microsoft/BotFramework-Comp…
benbrown Apr 27, 2021
0ae895e
Merge branch 'main' into benbrown/migrate
benbrown Apr 27, 2021
a114bd3
fix mapping of schema files during migration
benbrown Apr 27, 2021
fe68602
Merge branch 'benbrown/migrate' of https://github.com/microsoft/BotFr…
benbrown Apr 27, 2021
cd36b16
fix lint
benbrown Apr 27, 2021
21db3d7
fix default name of migrated project
benbrown Apr 27, 2021
f8d699f
run schema merge as part of the migration
benbrown Apr 28, 2021
be877bb
do we need to migrate teh schema? or not?
benbrown Apr 28, 2021
f342b87
do not migrate schema
benbrown Apr 28, 2021
23f938a
- Adding field for runtime language
pavolum Apr 28, 2021
f9f3f86
Passing runtime lang and type down to yeoman calls
pavolum Apr 28, 2021
a5c1f45
Merge branch 'main' of https://github.com/microsoft/BotFramework-Comp…
benbrown Apr 28, 2021
35f6696
Merge branch 'main' into benbrown/migrate
benbrown Apr 28, 2021
0d26615
Fixing adaptive runtime name
pavolum Apr 28, 2021
6e97e42
Hardcoding runtime version and fixing settings page generation on mig…
pavolum Apr 28, 2021
8549d11
Merge branch 'main' of https://github.com/microsoft/BotFramework-Comp…
benbrown Apr 28, 2021
ad59967
Fixing check for 'inBotMigration' to be based on CreationStatusState …
pavolum Apr 28, 2021
6278bab
Fix default naming
pavolum Apr 28, 2021
88bc8a8
revert preload.js
benbrown Apr 28, 2021
3aad038
Merging latest and resolving conflict
pavolum Apr 28, 2021
0b340bb
Resolving PR comments and fixing errors from merge
pavolum Apr 28, 2021
c836d9d
Merge branch 'pavolum/migrateUiFix' of https://github.com/microsoft/B…
benbrown Apr 28, 2021
6e6ea91
Change schema diagnostics severity to 'Error'
yeze322 Apr 29, 2021
e15fde5
Merge branch 'main' into benbrown/migrate
benbrown Apr 29, 2021
c4a87d6
Fetch @latest version from npm before migration
benbrown Apr 29, 2021
cfb39a2
Merge branch 'main' into benbrown/migrate
benbrown Apr 29, 2021
8399207
Merge branch 'main' of https://github.com/microsoft/BotFramework-Comp…
benbrown May 5, 2021
4b940d9
Merge branch 'main' of https://github.com/microsoft/BotFramework-Comp…
cwhitten May 5, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
userSettingsState,
templateProjectsState,
} from '../../../recoilModel';
import { localBotsDataSelector } from '../../../recoilModel/selectors/project';
import Home from '../../../pages/home/Home';
import { useProjectIdCache } from '../../../utils/hooks';
import { ImportModal } from '../../ImportModal/ImportModal';
Expand All @@ -43,6 +44,7 @@ const CreationFlowV2: React.FC<CreationFlowProps> = () => {
fetchFeed,
openProject,
saveProjectAs,
migrateProjectTo,
fetchProjectById,
createNewBotV2,
fetchReadMe,
Expand All @@ -52,6 +54,8 @@ const CreationFlowV2: React.FC<CreationFlowProps> = () => {
const creationFlowStatus = useRecoilValue(creationFlowStatusState);
const projectId = useRecoilValue(currentProjectIdState);
const storages = useRecoilValue(storagesState);
const botProjects = useRecoilValue(localBotsDataSelector);
const botProject = botProjects.find((b) => b.projectId === projectId);
const focusedStorageFolder = useRecoilValue(focusedStorageFolderState);
const { appLocale } = useRecoilValue(userSettingsState);
const cachedProjectId = useProjectIdCache();
Expand Down Expand Up @@ -150,13 +154,21 @@ const CreationFlowV2: React.FC<CreationFlowProps> = () => {
saveProjectAs(projectId, formData.name, formData.description, formData.location);
};

const handleMigrate = (formData) => {
handleDismiss();
Copy link
Member

Choose a reason for hiding this comment

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

handleDismiss sets the creation flow to CLOSE and then navigates home. Is that all synchronous? This then sets the status to MIGRATE. Do you want to only set the status to one state or does this need to go through the CLOSE state?

setCreationFlowStatus(CreationFlowStatus.MIGRATE);
migrateProjectTo(projectId, formData.name, formData.description, formData.location);
Copy link
Member

Choose a reason for hiding this comment

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

If formData has type any, do you want to check name, description, and/or location have values before calling migrateProjectTo?

};

const handleSubmit = async (formData, templateId: string) => {
handleDismiss();
switch (creationFlowStatus) {
case CreationFlowStatus.SAVEAS:
handleSaveAs(formData);
break;

case CreationFlowStatus.MIGRATE:
handleMigrate(formData);
break;
default:
saveTemplateId(templateId);
await handleCreateNew(formData, templateId);
Expand Down Expand Up @@ -217,6 +229,16 @@ const CreationFlowV2: React.FC<CreationFlowProps> = () => {
onDismiss={handleDismiss}
onOpen={openBot}
/>
<DefineConversationV2
createFolder={createFolder}
focusedStorageFolder={focusedStorageFolder}
path="migrate/:projectId"
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure what the path is for but do you need to add a route to router.tsx for migration?

Copy link
Contributor

Choose a reason for hiding this comment

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

Since this is is inside the creation flow I think this would take the creation route as prefix followed by migrate/:projectId as a sub routes

templateId={botProject?.name || 'migrated_project'} // templateId is used for default project name
updateFolder={updateFolder}
onCurrentPathUpdate={updateCurrentPath}
onDismiss={handleDismiss}
onSubmit={handleMigrate}
/>
<ImportModal path="import" />
</Router>
</Fragment>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ type DefineConversationProps = {
focusedStorageFolder: StorageFolder;
} & RouteComponentProps<{
templateId: string;
defaultName: string;
runtimeLanguage: string;
location: string;
}>;
Expand Down
1 change: 1 addition & 0 deletions Composer/packages/client/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ export enum CreationFlowStatus {
NEW_FROM_SCRATCH = 'Scratch',
NEW_FROM_TEMPLATE = 'Template',
SAVEAS = 'Save as',
MIGRATE = 'Migrate',
OPEN = 'Open',
CLOSE = 'Close',
}
Expand Down
Loading