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

Allow user to create an Event Hub namespace and/or Event Hub when creating EventHubTrigger #3713

Merged
merged 9 commits into from
Jun 30, 2023

Conversation

nturinski
Copy link
Member

Partially fixes #3550

@nturinski nturinski requested a review from a team as a code owner June 13, 2023 23:16
Co-authored-by: Brandon Waterloo [MSFT] <36966225+bwateratmsft@users.noreply.github.com>
bwateratmsft
bwateratmsft previously approved these changes Jun 14, 2023
@@ -11,6 +11,6 @@ export class EventHubNameStep extends StringPromptStep {
public shouldPrompt(context: IEventHubWizardContext & IBindingWizardContext): boolean {
// If the user decides to create a new app setting, `EventHubListStep` will take care of prompting
// Otherwise, prompt to manually enter the name of the event hub using this step
return !context.namespaceName && !context.eventhubname;
return !context.eventHubsNamespace && !context.eventhubname;
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Camel case?

eventhubname => eventHubName

Copy link
Member Author

Choose a reason for hiding this comment

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

There's a note in IEventHubWizardContext

  /**
     * NOTE: The name of this variable should not change. It matches the name of the binding setting written to function.json
     */
    eventhubname?: string;

newAuthRuleName?: string;
authRule?: AuthorizationRule;
newEventHubName?: string;
// Netherite uses all of the eventhub namespace settings in IEventHubWizardContext
Copy link
Contributor

@MicroFish91 MicroFish91 Jun 16, 2023

Choose a reason for hiding this comment

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

I'll double check some Netherite scenarios to make sure this doesn't break. We'll probably want CTI to pay extra attention to this flow when they do their test pass

More motivation for me to get some tests in for Durable as well...

import { ISubscriptionContext } from "@microsoft/vscode-azext-utils";
import { EventHubsConnectionTypeValues, StorageConnectionTypeValues } from "../../../../constants";
import { ISetConnectionSettingContext } from "../ISetConnectionSettingContext";

export interface IEventHubsConnectionWizardContext extends ISetConnectionSettingContext, Partial<ISubscriptionContext> {
resourceGroup?: ResourceGroup;
resourceGroup?: ResourceManagementModels.ResourceGroup;
Copy link
Contributor

Choose a reason for hiding this comment

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

Should the types be more like this?

image

Copy link
Member Author

Choose a reason for hiding this comment

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

Do you mean the spaces? I'm not sure what you're trying to highlight here.
Or the fact that it has resourceGroup as a property?

@@ -24,7 +25,6 @@ import { CosmosDBListStep } from './cosmosDB/CosmosDBListStep';
import { EventHubAuthRuleListStep } from './eventHub/EventHubAuthRuleListStep';
import { EventHubConnectionCreateStep } from './eventHub/EventHubConnectionCreateStep';
import { EventHubListStep } from './eventHub/EventHubListStep';
import { EventHubNamespaceListStep } from './eventHub/EventHubNamespaceListStep';
Copy link
Contributor

Choose a reason for hiding this comment

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

Are you missing an import for: EventHubsNamespaceListStep?

Copy link
Member Author

Choose a reason for hiding this comment

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

No idea why that got removed...

alexweininger
alexweininger previously approved these changes Jun 26, 2023
@nturinski nturinski merged commit ddb1926 into main Jun 30, 2023
@nturinski nturinski deleted the nat/eventHubNamespaceCreate branch June 30, 2023 20:44
@microsoft microsoft locked and limited conversation to collaborators Aug 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Node v4 model: Connection info not populated correctly for Cosmos and Service Bus triggers
4 participants