Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

feat: npm based 'new bot' flow behind feature flag - #5029

Merged
Chris Whitten (cwhitten) merged 100 commits into
mainfrom
pavolum/newCreation
Feb 10, 2021
Merged

Chris Whitten (cwhitten) merged 100 commits into
mainfrom
pavolum/newCreation

Conversation

@pavolum

@pavolum pavolum commented Dec 1, 2020 •

Copy link
Copy Markdown
Contributor

Description

This PR introduces the new creation experience work behind a hidden feature flag. It was implemented in such a way that the existing production creation experience should not be impacted whatsoever.

This PR merges the new creation experience so far, there are various edge cases it does not yet account for, hence why it is behind a hidden feature flag. Below is a high level list of what was done

  • Front and back end creation flow cloned and the copy was altered to support the new creation requirements
    • The cloned creation flow follows a 'v2' pattern where server and front end routing calls are prefaces with some 'v2' in the path
  • Implementation of getReadMe server endpoint which calls npm with a given package name and returns the readMe html for that package
  • Implementation of getProjTemplatesV2 server endpoint which is used to grab the npm template generators that are available in a given feed(s)
  • Implementation of hidden 'New Creation Experience' feature flag which routes to the new 'new bot' flow if checked
  • Added scaffolding of new runtime template for the new C# adaptive runtime, only slightly edited to ensure friendly local publish flow and build works.
  • CreateProjectAsync refactored to handle npm driven template installation, building and package resolution
    • As a result the 'Conversational Core' feature will no longer work, this feature flag has been reverted to be hidden
      • Done this way to not have to support three different creation flows at once

Task Item

fixes #5025
fixes #5026
fixes #5488
fixes #5502
fixes #5498
fixes #5489
fixes #5566

Known limitations

Screenshots

- Put new creation flow behind a feature flag
@pavolum

pavolum commented Dec 1, 2020

Copy link
Copy Markdown
Contributor Author

Ben Brown (@benbrown) pushing out draft PR for tracking. Didnt get as much time to tackle this today as id have liked but have set up the new flow behind a feature flag with cloned versions of the existing flow. Will start configuring the npm driven template feed tomorrow.

@coveralls

Coveralls (coveralls) commented Dec 2, 2020 •

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.2%) to 55.285% when pulling aceab97 on pavolum/newCreation into 50b8304 on main.

Comment thread Composer/packages/server/src/models/asset/assetManager.ts Outdated
Comment thread Composer/packages/client/src/components/CreationFlow/v2/CreateOptions.tsx Outdated
Comment thread Composer/packages/client/src/components/CreationFlow/v2/CreationFlow.tsx Outdated
Comment thread Composer/packages/client/src/constants.ts Outdated
Comment thread Composer/packages/server/src/models/asset/assetManager.ts
Comment thread Composer/packages/server/src/models/asset/assetManager.ts
}

private getFeedType(): FeedType {
// TODO: parse through data to detect for npm or nuget package schema and return respecive result

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I have code that does this in package manager.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ah thats right, I remember you mentioning that a while back. How shall we proceed? Want to send me the deets to that implementation and I can make the change to use that function?

Comment thread Composer/packages/server/package-lock.json Outdated
Comment thread Composer/packages/server/src/controllers/__tests__/project.test.ts Outdated
Comment thread Composer/packages/server/src/controllers/asset.ts Outdated
Comment thread Composer/packages/server/src/controllers/asset.ts Outdated
Comment thread Composer/packages/server/src/models/asset/assetManager.ts Outdated
if (!isLoadingInstalled) {
setIsLoadingInstalled(true);
try {
updateInstalledComponents([]);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why does this function invocation need to accept an empty array?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

That is resetting the state to an empty list while it loads...

- removing console.logs()
- removing unneeded comments
- removing package.json
- changing string interpolation
@cwhitten

Copy link
Copy Markdown
Member

ConversationalCore feature flag will no longer work

Other work streams are relying on this feature flag. Composer Adapters for one. Can you make sure to connect with Ben Y on the appropriate way to guard UX associated with the VA scenarios?

@pavolum

pavolum commented Feb 9, 2021

Copy link
Copy Markdown
Contributor Author

ConversationalCore feature flag will no longer work

Other work streams are relying on this feature flag. Composer Adapters for one. Can you make sure to connect with Ben Y on the appropriate way to guard UX associated with the VA scenarios?

Good to know, Ill ping him now!

@pavolum

pavolum commented Feb 9, 2021

Copy link
Copy Markdown
Contributor Author

ConversationalCore feature flag will no longer work

Other work streams are relying on this feature flag. Composer Adapters for one. Can you make sure to connect with Ben Y on the appropriate way to guard UX associated with the VA scenarios?

Good to know, Ill ping him now!

I spoke with Ben Y and we have a plan in place. Once this gets into main he will pull latest and make it such that the adapter feature is only shown if the NEW_CREATION_FLOW feature flag is checked. That way when I do the smaller PR that gets rid of the REMOTE_TEMPLATE_CREATION feature flag then his branch wont break when he pulls latest.

@cwhitten
Chris Whitten (cwhitten) dismissed stale reviews from Ben Brown (benbrown) and themself February 10, 2021 17:52

stale

@cwhitten
Chris Whitten (cwhitten) deleted the pavolum/newCreation branch February 10, 2021 17:53
leileizhang (lei9444) pushed a commit to lei9444/BotFramework-Composer-1 that referenced this pull request Jun 15, 2021
* - Cloned creation flow
- Put new creation flow behind a feature flag

* added fetchTemplateV2 which grabs templates from public npm and NuGet feeds

* minor feed changes

* Adding passed feedUrl support for template fetch

* initial implementation of template picker design

* populate template description view with corresponding readMe pulled from npm and viewed as html

* package instantiated on creation from npm [partial]

* yeomen template generation working e2e for conversational core

* Cleaned up old template flashing bug, changed runtime template

* Adding featureflag data to ExtensionContext

* clean up

* Yeomen generator template working e2e with new runtime generator package

* -Added ability for variable runtime command in appsettings
-cleaned up var names

* Clean up to ensure new creation flow does not affect legacy creation flow

* Adding runtime template for C# adaptive runtime

* Removing undoable template sideloading conditional since extensions cant access feature flag state

* Adding path to yeomon repo to process.env

* ensure yeomen env intialized .yo-repository dir in appData directory

* Make dictionary for feeds that are called to populate template view. Clean up template tab useEffect.

* removing unused code and comments. Fixed double telem bug.

* moved template readMe into local component state as opposed to recoil app state

* removing run command string manipulation code as this is now handled in the yeomen template

* Making template feeds strongly typed and removing UI conditional

* minor bug fix, creationFlow V1 mounts and loads V1 templates regardless of new creation FF.
Adding conditional to prevent template load on mount.

* grabbing templates when app loads

* Adding back in PVA integration to new create flow

* adding null check and removing commented code

* Adding missing fields in creation flow UI to be used later with template creation

* fix linting errors

* removing unsed import

* - moved yeomen env instanse to assetManager
- fixed versioning for name validation regex

* Put yeomen env creation behind feature flag

* fix required fields

* updates to make package manager work

* Load yeomenEnv regardless of Feature Flag value

* adjust azurepublish to work with new runtime format

* Added additional error handling and cleaned up code

* removing yeomen constructor params

* fix repo instantiation

* removing unneeded condtional

* apply fix to exclude generated content from the schema merger

* fix issue where package manager would reload feed unnecessarily

* undoing autoformat changes

* interface to type conversion and clean up

* Moving server calls from asset controller to assetManager

* removing package-lock.json

* removing commented code

* Added template versioning

* Initial readme implementation

* Fininshing readme change

* removing auto format changes

* Adding remaining telem

* implementation of initial component unit test

* added unit test ffor new fetchtemplate server endpoint

* adding createProjAsync unit test

* increase timeout for creation test

* Fixing test expectation to account for undefined PVA variables

* minor clean up

* Fixed dir in which .yo-repository dir is generated

* macked long runnning async creation call to isolate createProjV2 test

* Adding test for template feed grabbing

* moved controller function to service class as it is not an api endpoint

* properly mocked createProjAsync for testing

* removing unused references

* Adding unit test for feed driven template  instantiation with mocked yeomen lib to avoid test api calls

* Adding test for fetch read me flow with mocked fetch

* Adding feature flag considarations to contribution documentation

* updating yarn.lock with latest output from yarn install

* minor PR changes

* Removing console.log that was used for testing

* removing unused reference

* Making PR changes
- removing console.logs()
- removing unneeded comments
- removing package.json
- changing string interpolation

* fixing unit test

Co-authored-by: Patrick Volum <pavolum@microsoft.com>
Co-authored-by: Ben Brown <benbro@microsoft.com>
Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

6 participants