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

Update Snippet replacement syntax #20431

Closed
1 of 4 tasks
pakrym opened this issue Apr 15, 2021 · 6 comments
Closed
1 of 4 tasks

Update Snippet replacement syntax #20431

pakrym opened this issue Apr 15, 2021 · 6 comments
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. EngSys This issue is impacting the engineering system. MQ This issue is part of a "milestone of quality" initiative.

Comments

@pakrym
Copy link
Contributor

pakrym commented Apr 15, 2021

We are switching from the //@@ and /*@@*/ syntax for line replacement in snippets to a more C#-native #if SNIPPET .. #endif preprocessor directive.

Please switch your samples to use the new syntax. Example migration: https://github.com/Azure/azure-sdk-for-net/pull/20391/files#diff-988626950b27d8a9a30cfe0d394aba056f460eeadfd350f5f8e7b894f63c6c0d

Before:

 /*@@*/string workspaceId = TestEnvironment.WorkspaceId;
 //@@string workspaceId = "<workspace_id>";

After:

#if SNIPPET
            string workspaceId = "<workspace_id>";
#else
            string workspaceId = TestEnvironment.WorkspaceId;
#endif

🍏 appconfiguration

Owners:
@annelo-msft
@AlexanderSher

Files:

sdk/appconfiguration/Azure.Data.AppConfiguration/tests/samples/Sample10_SecretReference.cs
sdk/appconfiguration/Azure.Data.AppConfiguration/tests/samples/SampleSnippets.cs

attestation

Owners:
@anilba06

Files:

sdk/attestation/Azure.Security.Attestation/tests/Samples/AttestationServiceAttestationSamples.cs

communication

Owners:
@acsdevx-msft

Files:

sdk/communication/Azure.Communication.Chat/tests/samples/Sample2_MessagingOperations.cs
sdk/communication/Azure.Communication.Chat/tests/samples/Sample4_KeyConcepts.cs
sdk/communication/Azure.Communication.Common/tests/Identity/CommunicationTokenCredentialTest.cs
sdk/communication/Azure.Communication.Identity/tests/samples/Sample1_CommunicationIdentityClient.cs
sdk/communication/Azure.Communication.PhoneNumbers/tests/samples/Sample_PhoneNumbersClient.cs
sdk/communication/Azure.Communication.Sms/tests/SmsClientLiveTestBase.cs
sdk/communication/Azure.Communication.Sms/tests/SmsClientLiveTests.cs
sdk/communication/Azure.Communication.Sms/tests/samples/Sample1_SmsClient.cs

🍏 core

Owners:
@pakrym
@KrzysztofCwalina

Files:

sdk/core/Azure.Core/tests/AzureNamedKeyCredentialTests.cs
sdk/core/Microsoft.Azure.Core.NewtonsoftJson/tests/Samples/Readme.cs
sdk/core/Microsoft.Azure.Core.Spatial.NewtonsoftJson/tests/Samples/Readme.cs
sdk/core/Microsoft.Azure.Core.Spatial/tests/Samples/Readme.cs

eventhub

Owners:
@serkantkaraca
@jsquire

Files:

sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Snippets/MigrationGuideSnippetsLiveTests.cs
sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Snippets/ReadMeSnippetsLiveTests.cs
sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Snippets/Sample01_HelloWorldLiveTests.cs
sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Snippets/Sample02_EventProcessorConfigurationLiveTests.cs
sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Snippets/Sample03_EventProcessorHandlersLiveTests.cs
sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Snippets/Sample04_ProcessingEventsLiveTests.cs
sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Snippets/Sample05_IdentityAndSharedAccessCredentialsLiveTests.cs
sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Snippets/Sample06_RequestingStorageServiceVersionsLiveTests.cs
sdk/eventhub/Azure.Messaging.EventHubs/tests/Core/EventHubsConnectionStringPropertiesTests.cs
sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/MigrationGuideSnippetsLiveTests.cs
sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/ReadMeSnippetsLiveTests.cs
sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/Sample02_EventHubsClientsLiveTests.cs
sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/Sample03_EventHubMetadataLiveTests.cs
sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/Sample04_PublishingEventsLiveTests.cs
sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/Sample05_ReadingEventsLiveTests.cs
sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/Sample06_IdentityAndSharedAccessCredentialsLiveTests.cs
sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/Sample07_EarlierLanguageVersionsLiveTests.cs
sdk/eventhub/Microsoft.Azure.EventHubs/tests/Snippets/MigrationGuideSnippets.cs

🍏 formrecognizer

Owners:
@annelo-msft
@kinelski
@maririos

Files:

sdk/formrecognizer/Azure.AI.FormRecognizer/tests/samples/Sample11_ComposedModel.cs
sdk/formrecognizer/Azure.AI.FormRecognizer/tests/samples/Sample12_RecognizeBusinessCardsFromFile.cs
sdk/formrecognizer/Azure.AI.FormRecognizer/tests/samples/Sample12_RecognizeBusinessCardsFromUri.cs
sdk/formrecognizer/Azure.AI.FormRecognizer/tests/samples/Sample13_RecognizeInvoicesFromFile.cs
sdk/formrecognizer/Azure.AI.FormRecognizer/tests/samples/Sample13_RecognizeInvoicesFromUri.cs
sdk/formrecognizer/Azure.AI.FormRecognizer/tests/samples/Sample15_RecognizeIdDocumentsFromFile.cs
sdk/formrecognizer/Azure.AI.FormRecognizer/tests/samples/Sample15_RecognizeIdDocumentsFromUri.cs
sdk/formrecognizer/Azure.AI.FormRecognizer/tests/samples/Sample1_RecognizeContentFromFile.cs
sdk/formrecognizer/Azure.AI.FormRecognizer/tests/samples/Sample1_RecognizeContentFromUri.cs
sdk/formrecognizer/Azure.AI.FormRecognizer/tests/samples/Sample2_RecognizeCustomFormsFromFile.cs
sdk/formrecognizer/Azure.AI.FormRecognizer/tests/samples/Sample2_RecognizeCustomFormsFromUri.cs
sdk/formrecognizer/Azure.AI.FormRecognizer/tests/samples/Sample3_RecognizeReceiptsFromFile.cs
sdk/formrecognizer/Azure.AI.FormRecognizer/tests/samples/Sample3_RecognizeReceiptsFromUri.cs
sdk/formrecognizer/Azure.AI.FormRecognizer/tests/samples/Sample4_StronglyTypingARecognizedForm.cs
sdk/formrecognizer/Azure.AI.FormRecognizer/tests/samples/Sample5_TrainModelWithForms.cs
sdk/formrecognizer/Azure.AI.FormRecognizer/tests/samples/Sample6_TrainModelWithFormsAndLabels.cs
sdk/formrecognizer/Azure.AI.FormRecognizer/tests/samples/Sample7_ManageCustomModels.cs
sdk/formrecognizer/Azure.AI.FormRecognizer/tests/samples/Sample7_ManageCustomModelsAsync.cs
sdk/formrecognizer/Azure.AI.FormRecognizer/tests/samples/Sample8_CopyModel.cs
sdk/formrecognizer/Azure.AI.FormRecognizer/tests/samples/SampleSnippets.cs

🍏 keyvault

Owners:
@schaabs
@heaths

Files:

sdk/keyvault/Azure.Security.KeyVault.Administration/tests/samples/AccessControlSampleSnippets.cs
sdk/keyvault/Azure.Security.KeyVault.Administration/tests/samples/Sample1_BackupHelloWorld.cs
sdk/keyvault/Azure.Security.KeyVault.Administration/tests/samples/Sample1_RbacHelloWorld.cs
sdk/keyvault/Azure.Security.KeyVault.Administration/tests/samples/Sample2_RbacScopeAssignment.cs
sdk/keyvault/Azure.Security.KeyVault.Administration/tests/samples/Sample2_SelectiveRestore.cs
sdk/keyvault/Azure.Security.KeyVault.Administration/tests/samples/Sample3_BackRestoreResume.cs
sdk/keyvault/Azure.Security.KeyVault.Certificates/tests/CertificateClientLiveTests.cs
sdk/keyvault/Azure.Security.KeyVault.Certificates/tests/samples/Sample3_ImportCertificate.cs
sdk/keyvault/Azure.Security.KeyVault.Certificates/tests/samples/Sample3_ImportCertificateAsync.cs
sdk/keyvault/Azure.Security.KeyVault.Certificates/tests/samples/SampleSnippets.cs
sdk/keyvault/Azure.Security.KeyVault.Keys/tests/samples/Sample3_GetKeys.cs
sdk/keyvault/Azure.Security.KeyVault.Keys/tests/samples/Sample3_GetKeysAsync.cs
sdk/keyvault/Azure.Security.KeyVault.Keys/tests/samples/SampleSnippets.cs
sdk/keyvault/Azure.Security.KeyVault.Secrets/tests/samples/Sample3_GetSecrets.cs
sdk/keyvault/Azure.Security.KeyVault.Secrets/tests/samples/Sample3_GetSecretsAsync.cs
sdk/keyvault/Azure.Security.KeyVault.Secrets/tests/samples/SampleSnippets.cs
sdk/keyvault/Microsoft.Azure.KeyVault/tests/SampleSnippets.cs

🍏 metricsadvisor

Owners:
@kinelski

Files:

sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/Samples/Sample01_DataFeedCrudOperations.cs
sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/Samples/Sample02_DataFeedIngestionOperations.cs
sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/Samples/Sample03_DetectionConfigurationCrudOperations.cs
sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/Samples/Sample05_AlertConfigurationCrudOperations.cs
sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/Samples/Sample06_QueryTriggeredAlerts.cs
sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/Samples/Sample07_QueryDetectedAnomalies.cs
sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/Samples/Snippets.cs

monitor

Owners:
@sameergMS
@dadunl

Files:

sdk/monitor/Azure.Monitory.Query/tests/LogsClientSamples.cs

🍏 search

Owners:
@brjohnstmsft
@arv100kri
@bleroy
@Mohit-Chakraborty
@tg-msft
@heaths

Files:

sdk/search/Azure.Search.Documents/tests/Samples/Readme.cs
sdk/search/Azure.Search.Documents/tests/Samples/Sample01_HelloWorld.cs
sdk/search/Azure.Search.Documents/tests/Samples/Sample04_FieldBuilderIgnore.cs
sdk/search/Azure.Search.Documents/tests/Samples/Sample05_IndexingDocuments.cs
sdk/search/Azure.Search.Documents/tests/Samples/Sample06_EncryptedIndex.cs

servicebus

Owners:
@JoshLove-msft
@jsquire

Files:

sdk/servicebus/Azure.Messaging.ServiceBus/tests/Primitives/ServiceBusConnectionStringPropertiesTests.cs
sdk/servicebus/Azure.Messaging.ServiceBus/tests/Samples/Sample01_HelloWorld.cs
sdk/servicebus/Azure.Messaging.ServiceBus/tests/Samples/Sample02_MessageSettlement.cs
sdk/servicebus/Azure.Messaging.ServiceBus/tests/Samples/Sample03_SendReceiveSessions.cs
sdk/servicebus/Azure.Messaging.ServiceBus/tests/Samples/Sample04_Processor.cs
sdk/servicebus/Azure.Messaging.ServiceBus/tests/Samples/Sample05_SessionProcessor.cs
sdk/servicebus/Azure.Messaging.ServiceBus/tests/Samples/Sample06_Transactions.cs
sdk/servicebus/Azure.Messaging.ServiceBus/tests/Samples/Sample07_CrudOperations.cs

storage

Owners:
@tg-msft
@amishra-dev
@seanmcc-msft
@amnguye
@kasobol-msft

Files:

sdk/storage/Azure.Storage.Blobs.Batch/samples/Sample03a_Batching.cs
sdk/storage/Azure.Storage.Blobs/samples/Sample01a_HelloWorld.cs
sdk/storage/Azure.Storage.Blobs/samples/Sample01b_HelloWorldAsync.cs
sdk/storage/Azure.Storage.Files.Shares/samples/Sample01a_HelloWorld.cs
sdk/storage/Azure.Storage.Files.Shares/samples/Sample01b_HelloWorldAsync.cs
sdk/storage/Azure.Storage.Queues/samples/Sample01a_HelloWorld.cs
sdk/storage/Azure.Storage.Queues/samples/Sample01b_HelloWorldAsync.cs

synapse

Owners:
@aim-for-better
@idear1203
@chamons

Files:

sdk/synapse/Azure.Analytics.Synapse.AccessControl/tests/samples/Sample1_HelloWorld.cs
sdk/synapse/Azure.Analytics.Synapse.Artifacts/tests/samples/Sample1_HelloWorldPipeline.cs
sdk/synapse/Azure.Analytics.Synapse.Artifacts/tests/samples/Sample2_HelloWorldNotebook.cs
sdk/synapse/Azure.Analytics.Synapse.Artifacts/tests/samples/Sample3_HelloWorldTrigger.cs
sdk/synapse/Azure.Analytics.Synapse.Artifacts/tests/samples/Sample4_HelloWorldDataFlow.cs
sdk/synapse/Azure.Analytics.Synapse.Artifacts/tests/samples/Sample5_HelloWorldDataset.cs
sdk/synapse/Azure.Analytics.Synapse.Artifacts/tests/samples/Sample6_HelloWorldLinkedService.cs
sdk/synapse/Azure.Analytics.Synapse.ManagedPrivateEndpoints/tests/samples/Sample1_HelloManangedPrivateEndpoint.cs
sdk/synapse/Azure.Analytics.Synapse.Spark/tests/samples/Sample1_SubmitSparkJob.cs
sdk/synapse/Azure.Analytics.Synapse.Spark/tests/samples/Sample1_SubmitSparkJobAsync.cs
sdk/synapse/Azure.Analytics.Synapse.Spark/tests/samples/Sample2_ExecuteSparkStatement.cs
sdk/synapse/Azure.Analytics.Synapse.Spark/tests/samples/Sample2_ExecuteSparkStatementAsync.cs

🍏 tables

Owners:
@christothes

Files:

sdk/tables/Azure.Data.Tables/tests/samples/Sample1_CreateDeleteTable.cs
sdk/tables/Azure.Data.Tables/tests/samples/Sample6_TransactionalBatchAsync.cs

🍏 textanalytics

Owners:
@annelo-msft
@maririos
@suhas92

Files:

sdk/textanalytics/Azure.AI.TextAnalytics.Protocol/tests/snippets/JsonDataSnippets.cs
sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/SampleSnippets.cs

🍏 translation

Owners:
@maririos

Files:

sdk/translation/Azure.AI.Translation.Document/tests/samples/SampleSnippets.cs
sdk/translation/Azure.AI.Translation.Document/tests/samples/Sample_MultipleInputs.cs
sdk/translation/Azure.AI.Translation.Document/tests/samples/Sample_MultipleInputsAsync.cs
sdk/translation/Azure.AI.Translation.Document/tests/samples/Sample_PollIndividualDocuments.cs
sdk/translation/Azure.AI.Translation.Document/tests/samples/Sample_PollIndividualDocumentsAsync.cs
sdk/translation/Azure.AI.Translation.Document/tests/samples/Sample_StartTranslation.cs
sdk/translation/Azure.AI.Translation.Document/tests/samples/Sample_StartTranslationAsync.cs
@pakrym pakrym added the EngSys This issue is impacting the engineering system. label Apr 15, 2021
@maririos maririos added the Client This issue points to a problem in the data-plane of the library. label Apr 15, 2021
@heaths
Copy link
Member

heaths commented Apr 15, 2021

There should be no markdown changes, though for KV and Search this exercise yielded a couple bugs so I ended up with 3 desirable markdown changes.

@pakrym
Copy link
Contributor Author

pakrym commented Dec 3, 2021

We are almost there, only

synapse
communication
eventhub
attestation

left.

@heaths
Copy link
Member

heaths commented Feb 2, 2023

Running the following script, I still find the following client libraries are using this older syntax:

  • attestation (6)
  • communication (200)
  • identity (1)
  • storage (40)
$found = dir sdk | dir -include Azure.* | dir -filter *.cs -recurse | select-string '(//@@|/\*@@\*/)'
$found | group @{e={$relpath = $_.relativepath($PWD); $relpath.Substring(4, $relpath.indexof('\', 4) - 4) }} -NoElement | sort count -desc

I'll update the OP to make use of "new" task lists to track these.

Copy link

github-actions bot commented Mar 4, 2024

Hi @pakrym, we deeply appreciate your input into this project. Regrettably, this issue has remained inactive for over 2 years, leading us to the decision to close it. We've implemented this policy to maintain the relevance of our issue queue and facilitate easier navigation for new contributors. If you still believe this topic requires attention, please feel free to create a new issue, referencing this one. Thank you for your understanding and ongoing support.

@pallavit
Copy link
Contributor

@kinelski can we remove the older syntax?

Copy link

Hi @pakrym, we deeply appreciate your input into this project. Regrettably, this issue has remained inactive for over 2 years, leading us to the decision to close it. We've implemented this policy to maintain the relevance of our issue queue and facilitate easier navigation for new contributors. If you still believe this topic requires attention, please feel free to create a new issue, referencing this one. Thank you for your understanding and ongoing support.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 26, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Apr 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Client This issue points to a problem in the data-plane of the library. EngSys This issue is impacting the engineering system. MQ This issue is part of a "milestone of quality" initiative.
Projects
None yet
Development

No branches or pull requests

5 participants