Граф коммитов

1124 Коммитов

Автор SHA1 Сообщение Дата
Jeremy Meng 696ec98edf
[engsys] fix check-format failures (#24439)
* [engsys] fix check-format failures

- keyvault-command doesn't have samples-dev directory
- result of of `rush format`.  formatting changes that potentially caused by prettier upgrade

* form-recognizer api.md formatting change
2023-01-11 14:07:08 -08:00
Azure SDK Bot 0d5dd9370e
Post release automated changes for servicebus releases (#24222)
Post release automated changes for azure-arm-servicebus
2022-12-16 07:28:15 +00:00
kazrael2119 947c83bacd
recording refresh 18 (#24153)
* recording refresh 18

* update files

* update files

* update files

* update files

* update files

* update files

* update files

* merge main

* update files

* update files
2022-12-14 07:40:43 +00:00
Jeremy Meng 63cf6bead5
[engsys] upgrade dev dependency `puppeteer` to `^19.2.2` (#24152)
* upgrade dev dependency `puppeteer` to `^19.2.2`

* update pnpm-lock.yaml

* Fix failing tests

by changing them to verify `error.name`.  The error message from parsing an
incomplete JSON string has been improved in recent versions of chromium.
Unfortunately it doesn't match NodeJS version any more.
2022-12-07 13:15:35 -08:00
Jeff Fisher fb5620edac
Update stress Dockerfile (#24047) 2022-12-01 13:32:14 -08:00
Jeremy Meng a9f4825c7c
[engsys] Upgrade dev dependency `dotenv` version to `^16.0.0` for selected packages (#24020)
to have pipelines' validation.
2022-11-28 15:39:15 -08:00
Jeremy Meng 81d16aaa52
[ServiceBus] move a logging line to a better place (#23854)
Currently that log looks unrelated to any nearby code. This PR moves it to a
better place where the `maxConcurrentCalls` options is set. The info logged
 still remains the same.
2022-11-15 13:40:07 -08:00
Jeremy Meng 8f0b81b390
[ServiceBus] resolve received messages immediately when we got extra (#23779)
The comments indicates that it is possible that we receive more messages than we ask for, and we want to return them. However, in current code we only resolve after max-wait-time-after-first message has passed once we have extra because of the length equality check, and during the wait time, more messages could still arrive.

This PR changes to remove immediately when we get what we ask for or more.
2022-11-09 16:09:26 -08:00
Jeremy Meng ba2b448f34
[core-amqp] request response link should reject when sender error (#23646)
When the remote closes the sender with an error we currently just log the error logged as a warning and are not doing anything else. Since we won't receive any response, the send operation eventually times out, rejecting with `OperationTimeoutError`. As `OperationTimeoutError` is retryable, we would get the same time out error in each retry again, even though some sender errors are not retryable, for example, `MessageSizeExceeded` error in issue #23623.

This PR rejects the promise of request on sender_error events so that it fails with proper errors. These errors still go through the retry logic, but should be failing faster.

### Packages impacted by this PR
`@azure/core-amqp`
2022-11-09 16:05:17 -08:00
Azure SDK Bot 5c88781df8
Post release automated changes for azure-service-bus (#23758) 2022-11-08 12:02:58 -08:00
Jeremy Meng 6aebbbb47b
[ServiceBus] prepare for 2022 November release (#23670)
- update CHANGELOG
2022-11-07 10:11:24 -08:00
Jeff Fisher 526926acc6
Upgrade TypeScript to 4.8 for most packages (#23730) 2022-11-05 01:24:43 +00:00
Jeff Fisher 731ac27db8
Remove unnecessary @azure/core-http deps (#23671) 2022-11-02 19:18:47 +00:00
Jeremy Meng 1906b99ff5
[ServiceBus] correct core-paging dependency version (#23561)
It should've been updated to 1.4.0 when merging main but was missed.
2022-10-19 12:48:21 -07:00
Jeremy Meng e370b64c4b
[core-amqp,service-bus] add react-native mappings (#23524)
- for entry point, and
- for runtime info
2022-10-14 17:35:17 -07:00
Jeremy Meng 98508cfa18 [EngSys] update engines required node version and @types/node version to v14
***NO_CI***

- string replace in package json: 12 => 14 for engines/node and for dependency @types/node
- eslint: update `json-engine-is-present` rule to 14.0.0 as LTS version
- identity: react to typing improvements for `readFile()`'s `options.encoding`
- trivial generated api.md file changes due to @types/node version bump
2022-10-14 14:29:35 -07:00
Jeremy Meng 8858778803
[ServiceBus] use `core-paging` primitive for RuleManager `listRules()` (#23434)
RuleManager's `listRules()` async paging operation was implemented manually.  Using core-paging primitive instead greatly reduces the code.

Service Bus doesn't support getting the total number of rules, so we only know that results are exhausted when the service returns an empty array. However, currently `core-paging` api would force us to return a page of empty result and undefined `nextPageLink` to stop the enumeration:

* current `getPage()` calls service api to get up to `maxPageSize` of elements. Suppose this is the last batch of results from service.
* `getPage()` returns a page of `{ page: results, nextPageLink: pageLink + results.length }` because we don't know yet whether there are more results we will try to get more.
* next `getPage()` calls service api again, getting empty results back
* With current core-paging api, we can now use `{ page: results, nextPageLink: undefined }` to stop paging.  However, it is a page with an empty array, which is undesirable.

To address this, this PR also updates core-paging to allow returning `undefined` from `PagedResult.getPage` and we stop yielding pages after receiving an undefined page.

### Packages impacted by this PR
`@azure/core-paging`
`@azure/service-bus`

### Issues associated with this PR
#22108
2022-10-12 12:19:55 -07:00
Azure SDK Bot 99819d3e42
Post release automated changes for azure-service-bus (#23480) 2022-10-11 23:57:46 +00:00
Jeremy Meng 4f44c2584a
[ServiceBus] Prepare for Oct. 2022 release (#23403)
- update release date
- add changelog entry
2022-10-05 11:16:44 -07:00
Jeremy Meng 36cf1de165
[ServiceBus] add tracing spans for more operations (#23334)
- receiver common:  complete, defer, abandon, deadLetter
- normal receiver: renewMessageLock
- session receiver: renewSessionLock, setSessionState, getSessionState
- when sending a single message


### Packages impacted by this PR
`@azure/service-bus`

### Issues associated with this PR
https://github.com/Azure/azure-sdk-for-js/issues/11858
2022-10-04 16:51:50 -07:00
Charles Mwaniki 0906e6dead
[Service Bus] Update comment to refer to the right JS file (#23249)
* Update comment to refer to the right JS file 

Change made is with regard to update the comment to which Javascript file to be ran under the `javascript` parent folder.

* Remove TS file extension in the comment

* Update sdk/servicebus/service-bus/samples/v7/javascript/receiveMessagesLoop.js

Co-authored-by: Harsha Nalluru <sanallur@microsoft.com>
2022-10-03 15:30:57 -07:00
Jeremy Meng e90ef49d8d
[Doc][ServiceBus] add troubleshooting guide (#23322) 2022-09-28 17:14:29 -07:00
Jeremy Meng 6c881ed3a1 [engsys] upgrade dev dependency `@microsoft/api-extractor` to `^7.31.1`
***NO_CI***

- bump api-extractor dev dependency to ^7.31.1 for all packages
- insignificant review file changes for cosmos and blob
2022-09-22 17:09:15 -07:00
Jeremy Meng f280f87f7b [engsys] fix broken nodejs lts schedule link
On https://nodejs.org/ it is now point to https://github.com/nodejs/release#release-schedule

***NO_CI***
2022-09-19 16:37:05 -04:00
Jeremy Meng be0a582beb
[ServiceBus] Pass timeout to server when accepting next session (#23210)
This is ported from .NET PR https://github.com/Azure/azure-sdk-for-net/pull/30963

The service hardcodes a max of 1 minute and 5 seconds when accepting a session.
This means the retry timeout the user specifies in the client is ignored if they
specify a value higher than this. We should specify the timeout property in the
link settings properties when opening a link for next available session to
support long polling.
2022-09-15 12:10:28 -07:00
Harsha Nalluru f4f5dc4b75
[Service Bus] Stress Tests Project - Fix failures (#23053)
* fix build failures

* updates as suggested

* formatting

* stress-test-resources.json gitignore

* remove get_helm.sh

* 0.1.20

* delete stress-test-resources.json
2022-09-14 22:08:56 +00:00
Jeremy Meng fa04a384bf
[Doc][EventHubs,ServiceBus] Add information about bundling using Rollup (#23184) 2022-09-13 15:45:07 -07:00
Jeremy Meng 970778b7c5
[engsys] update dep core-util version to `^1.1.1` (#23175)
to ensure packages can get the `delay()` refactoring.

Without this change our `js - core` nightly is failing. It would fail the min-max testing as well.

What's happening is that our nightly pipeline does something special: for example, rewriting our @azure/core-util package versions to be like "1.1.1-alpha.20220909.2" so we can publish nightly alpha package of this version to npmjs.org.

If our other packages depend on the same minimum version (^1.1.1) then we also update the version to be ">=1.1.1-alpha <1.1.1-alphb" then rush would be able to find this version in the repository and we are building and testing against the version to be published.

However, if the version doesn't match (^1.1.0 in this case), we would not modify the dep version, and rush would get v1.1.0 from npmjs instead thus failed the build.

Using "^1.1.1" is also more correct for end users, as v1.1.0 satisfies the sem version ^1.1.0 but doesn't work.
2022-09-09 13:05:34 -07:00
Minh-Anh Phan a6e366d526
[core-util] Update "delay" method in core-util with abort options (#23019)
### Packages impacted by this PR
core-util

### Issues associated with this PR
#15930 

### Describe the problem that is addressed by this PR
- Update "delay" in core-util to support abort message
- Unduplicate "delay" function in core-http and core-amqp

### What are the possible designs available to address the problem? If there are more than one possible design, why was the one in this PR chosen?
- Choose the implementation with "options" parameters to keep the flexibility in case we want to add extra functionality in the future 

### Are there test cases added in this PR? _(If not, why?)_


### Provide a list of related PRs _(if any)_
#15832

### Command used to generate this PR:**_(Applicable only to SDK release request PRs)_

### Checklists
- [x ] Added impacted package name to the issue description
- [ ] Does this PR needs any fixes in the SDK Generator?** _(If so, create an Issue in the [Autorest/typescript](https://github.com/Azure/autorest.typescript) repository and link it here)_
- [ ] Added a changelog (if necessary)
2022-09-09 00:08:36 +00:00
Azure SDK Bot 25d19ea0d0
Post release automated changes for servicebus releases (#23135)
Post release automated changes for azure-service-bus
2022-09-07 22:30:22 +00:00
Jeremy Meng d98d442fa6
[engsys] upgrade `downlevel-dts` version to ^0.10.0 (#23131)
This fixes an error in automated `rush update --full` build.

***NO_CI***
2022-09-07 11:29:19 -07:00
Jeremy Meng 4b735fdc5c
[engsys] prepare for 2022 September release (#23133)
- update CHANGELOG
2022-09-07 11:12:29 -07:00
Harsha Nalluru 9f2a8de156
[Service Bus] Fix test failures (#23081) 2022-09-07 08:17:38 +00:00
Jeremy Meng 909a485ee9
[ServiceBus][Test] remove tests ensuring unexpected sample changes (#23079)
Previously our `build:samples` script would modify samples to import from
source. However, newer sample workflow no longer does this, and the
`build:samples` script now just "echo Obsolete".

This PR removes tests that guard against committing unwanted sample changes.
2022-09-01 17:02:30 -07:00
Jeremy Meng fd849fcc35
[core] prepare for 2022 Sep releases (#23060)
- Bump core-util minor version
- Update CHANGELOG files
- Update packages that depends on the particular change in this version.
- Remove -beta.1 as we already GA @azure/core-util.
2022-08-31 20:31:25 -07:00
Harsha Nalluru 108b2951be
[Service Bus] Enable sending large messages (#23014)
* new test

* fix sending large messages

* formatting and docs

* format

* changelog

* more docs

* Update sdk/servicebus/service-bus/CHANGELOG.md

Co-authored-by: Jeremy Meng <yumeng@microsoft.com>

* Update sdk/servicebus/service-bus/test/internal/sendBatch.spec.ts

* Apply suggestions from code review

* fix error message

Co-authored-by: Jeremy Meng <yumeng@microsoft.com>
2022-08-30 04:56:50 -07:00
Timo van Veenendaal 51045d640e
[Event Hubs, Service Bus] Remove unnecessary dependency on `@types/long` (#22923) 2022-08-17 15:49:28 -07:00
Daniel Getu f6c54e192b
Move common type guards into core-util (#22872)
A few type guards had duplicate definitions in multiple packages. This change moves the common functions to `core-util`.

Fixes #21734
2022-08-12 12:44:32 -07:00
Azure SDK Bot 88a950b575
Post release automated changes for azure-service-bus (#22817) 2022-08-05 00:46:43 +00:00
Jeremy Meng c9bac58df7
[ServiceBus] prepare for 2022 Aug release (#22728)
- update date in CHANGELOG
2022-08-02 13:16:46 -10:00
Jeremy Meng 2d7248ef59
[ServiceBus] add `identifer` property to more types and options (#22740)
- add public `identifier` property to senders, receivers, and their
corresponding options

- `ProcessErrorArgs` now has `identifier` indicating by
which client the error is raised.
2022-08-02 11:35:55 -10:00
Jeremy Meng d6daca9848
[ServiceBus] fix existence checking of `fromSequenceNumber` option (#22702)
We intended to call `peekBySequenceNumber()` when `PeekMessagesOptions.fromSequenceNumber`
property is specified.  However, currently other falsy values would also fail
the condition. This resulting in `peek()` is called instead, leading to
unexpected behavior.

This PR changes the condition to check for `undefined`.
2022-07-25 10:13:52 -10:00
Jeremy Meng 84fabfd41e [engsys] upgrade `typescript` to `^4.6.0` for rest packages
***NO_CI***

This is a follow-up to PR #21536 and PR #21537.

- upgrade typescript to 4.6.0 for communication packages

- upgrade typescript to 4.6 for test-utils and dev-tool

- upgrade typescript to 4.6
2022-07-22 16:41:43 -04:00
Jeremy Meng fee80ce366
[ServiceBus] Add a sample of authenticating with AzureNamedKeyCredential (#22657)
* [ServiceBus] Add a sample of authenticating with AzureNamedKeyCredential

- add sample
- add a new auth rule and related env variables in test-resources.json
- update sample.env to have the new env variables
- use SERVICEBUS_HOSTNAME because the service endpoint contains https:// at the beginning and should not be sent to service.
2022-07-22 06:43:37 -10:00
Jeremy Meng 51578dc147
[ServiceBus] Fix bug in converting ServiceBusMessage to RheaMessage (#22665)
when the `ServiceBusMessage` has `timeToLive` property set.

The problem is that we are adding a number to a `Date` object, resulting in an
invalid date value for `absolute_expiry_time`. This PR corrects it by calling
`getTime()` on the `Date` object first before adding the ttl number.

A unit test is added and the sendMessages sample is updated to show how to set
`timeToLive`.
2022-07-21 09:37:56 -10:00
Jeremy Meng 1189a61825
[ServiceBus] Add `identifier` property to `ServiceBusClient` (#22573)
* [ServiceBus] Add `identifier` property to `ServiceBusClient`

It's main purpose is to help correlate client logs and errors. It can be
specified when creating instances of `ServiceBusClient` via optional
`ServiceBusClientOptions.identifier`. If not specified, a unique one will be
generated.

- add property and client option
- plumbing the identifier to the link for sender and receiver

* React to lib code change.

* Add client id to `com.microsoft:receiver-name` link property for receiving

* update CHANGELOG

* Add some unit tests
2022-07-14 16:13:23 -10:00
Jeremy Meng 8bbc58b335
[ServiceBus] migrate to `@azure/core-tracing` v1.0.0 (#22517)
* Move to `core-tracing` GA version ^1.0.0

* Update tracing support

* React to tracing changes in v1.0.0

* Remove test that no longer needed as the method was removed

* Fix util unit tests

* Remove createServiceBusSpan, createProcessingSpan, and createAndEndProcessingSpan

* Update changelog

* Remove deprecated `TryAddOptions.parentSpan` property

* Bump minor version
2022-07-12 10:26:45 -10:00
Azure SDK Bot eed1276671
Post release automated changes for azure-service-bus (#22498) 2022-07-07 23:44:58 +00:00
Jeremy Meng 85a4887373
[ServiceBus] prepare for 2022 July GA release (#22455)
* [ServiceBus] prepare for 2022 July release

- change to use public trimmed type definition files for GA release
- update changelog

* Update release date
2022-07-07 08:40:22 -10:00
Jeremy Meng 5cc91f7f78
Add an `createRule` overload that doesn't take `ruleAction` (#22478)
* Add an `createRule` overload that doesn't take `ruleAction`

* fix format
2022-07-06 11:14:41 -10:00
Harsha Nalluru 1e472dac3e
[Service Bus] Improves documentation for `maxAutoLockRenewalDurationInMs` (#22343)
* Improves documentation for `maxAutoLockRenewalDurationInMs`

* Update sdk/servicebus/service-bus/src/models.ts

Co-authored-by: Jesse Squire <jesse.squire@gmail.com>

* Update sdk/servicebus/service-bus/src/models.ts

Co-authored-by: Jesse Squire <jesse.squire@gmail.com>

* Update sdk/servicebus/service-bus/src/models.ts

Co-authored-by: Jesse Squire <jesse.squire@gmail.com>

* Apply suggestions from code review

* improve

* PR LINK

Co-authored-by: Jesse Squire <jesse.squire@gmail.com>
2022-06-23 23:04:46 +00:00
Jeremy Meng d7987077ac
[ServiceBus] Add a sample for RuleManager (#22158)
- add sample
- publish samples
2022-06-10 14:41:52 -07:00
Jeremy Meng 2c49cc1cc2
[ServiceBus][Test] resetTracer at the end of tracing test (#22161)
so it won't impact following tests
2022-06-09 10:45:44 -07:00
Jeremy Meng 79bb5b3bc7
[ServiceBus] don't yield empty page when listing rules in RuleManager (#22159)
We should stop when there's no more returned rules. I did this previously
probably to support continuationToken as we have to make the last request to
know that there are no more results, and we then set continuationToken to
undefined on this empty page.  Now that the continuationToken is removed, we can
stop yielding empty page.
2022-06-09 10:09:04 -07:00
Ben Zhang 098abbd45c
[Service Bus] topic filter sample in ``.ts`` (#21812)
* set up sample for filters

* modeling topicSubscription sample similar to .cs versions

* creating topics, subscriptions, and deleting rules

* created subscriptions with name, filter, and action (optional)

* should have sample done, but cannot run on basic tier

* added comments

* format

* revision

* formatting

* revised expected output

* revised naming and comments

* added clarifying comments

* delete samples

* update samples/

* restore samples/v7

* checkout
2022-06-08 12:43:13 -07:00
Azure SDK Bot 705a5024f1
Post release automated changes for azure-service-bus (#22147) 2022-06-08 00:20:26 +00:00
Jeremy Meng 067dad7e7e
[ServiceBus] prepare for June 2022 release (#22139)
- update CHANGELOG
2022-06-07 16:29:53 -07:00
Jeremy Meng 1a59ad1de8
[ServiceBus] workaround a service issue by using page size of 100 (#22142)
Testing reveals that if we use max int as maxCount, and also use top then
service will return InternalServerError.

This PR workarounds around that by defaulting to 100 as maxPageSize.
2022-06-07 16:29:25 -07:00
Jeremy Meng 0a876d1546
[servicebus][test] Ensure test clean up (#22138)
This PR adds a try-finally block to ensure test clean up in cases of test
failing.
2022-06-07 13:38:02 -07:00
Jeremy Meng 31cf997d27
[servicebus][test] assert on expected properties (#22137)
This RP rewrites the assertion with excluded properties with assertion on
expected properties. as log of `deepEqualExcluding()` doesn't give enough
information on the difference when the assertion fails.
2022-06-07 12:49:56 -07:00
Jeremy Meng e10172a86b
[ServiceBus] add subscription-level rule manager. (#22018)
### Packages impacted by this PR
@Azure/service-bus 

This existed in Track 1 and allowed users with only Listen claims to manage rules on the subscription that they had listen claims for. In Track 2, this can be done using the `ServiceBusAdministrationClient`, but Get Rules and List Rules require Manage claims.

This PR adds a rule manager that can add, delete, and retrieve rules for a specified subscription via AMQP link.

### Issues associated with this PR
#20890
2022-06-06 16:32:28 -07:00
hamsa-s d3928de4d9
Additional DeadLetterQueueSample for Service Bus (#21818)
* added sample

* minor fixes

* published samples

* added samples
2022-06-01 09:44:06 -07:00
praveenkuttappan 442240da53
Update docker registry using args (#22058) 2022-06-01 09:55:49 -04:00
Jeremy Meng 86cbca6548 [eslint] enable linter rules for README javascript code blocks
***NO_CI***

Co-authored-by: Wei Jun <67103802+WeiJun428@users.noreply.github.com>

- [x] template

Enable README Eslint (#21612)

* fixed ai-anomaly-detector

* fixed minor error

* fixed app-configuration

* fixed communication-chat

* fixed communication-common

* fixed communication-identity

* fixed communication-network-traversal

* fixed communication-phone-numbers

* fixed communication-short-codes

* fixed communication-sms

* fixed container-registry

* fixed digital-twins-core

* fixed eventgrid

* fixed event-hubs

* fixed ai-form-recognizer

* fixed opentelemetry-instrumentation-azure-sdk

* fixed mixed-reality-authentication

* fixed quantum-jobs

* fixed mixed-reality-remote-rendering

* fixed schema-registry

* fixed service-bus

* fixed storage-blob

* fixed storage-file-datalake

* fixed storage-file-share

* fixed storage-queue

* fixed data-tables

* fixed video-analyzer-edge

* fixed web-pubsub

* fixed web-pubsub-express

* partially fixed attestation

* added target to lint:fix in attestation

* fixed ai-anomaly-detector

* revert attestation

* fixed container-registry

* fixed digital-twins-core

* fixed eventgrid

* fixed opentelemetry-instrumentation-azure-sdk

* fixed mixed-reality-authentication

* fixed mixed-reality-remote-rendering

* storage-blob

* fixed storage-file-datalake

* fixed storage-file-share

* fixed storage-queue

* fixed template

* fixed ai-text-analytics

* fixed schema-registry-arvo

* fixed ai-metric-advisor

* fixed eventhubs-checkpointstore-table

* fixed eventhubs-checkpointstore-blob

* fixed identity-vscode

* fixed identity-cache-persistence

Add `-ext .ts,.javascript,.js` option back

This option is used to specify file patterns under directories. Without it,
unwanted files (e.g., *.json under test folder) will be linted.
2022-05-24 11:58:40 -07:00
Jeremy Meng 83e13d88f9 [engsys] upgrade `eslint` dev dependency version to ^8.0.0 for rest packages
***NO_CI***
2022-05-20 13:21:30 -07:00
Azure SDK Bot 4b00bed8cf
Post release automated changes for servicebus releases (#21937)
Post release automated changes for azure-service-bus
2022-05-20 00:37:16 +00:00
Jeremy Meng f77f8f68f5
[ServiceBus] Fix `types` for beta release (#21931)
Previous change update the package to include beta-trimmed dts rollup but missed
updating the `types` field.  This PR fixes it.
2022-05-19 21:15:59 +00:00
Jeremy Meng 4498fecbed
[service-bus] prepares an out-of-band beta release (#21930)
for the `omitMessageBody` feature.
2022-05-19 12:23:27 -07:00
Jeremy Meng 81a37f146c
[ServiceBus] enable beta-trimmed api-extractor dts rollup (#21872)
in public-trimmed dts rollup, @beta APIs are removed. Because we only ship
public-trimmed version it prevents us from gathering feedback for @beta APIs.
This PR enable generation of beta-trimmed dts rollup.

Use beta-trimmed dts rollup for beta release
2022-05-19 11:07:40 -07:00
Jeremy Meng 8c5a83d97d
[eslint-plugin] upgrade eslint dependencies (#21733)
- eslint to ^8.0.0
  - @types/eslint to ~8.4.0
  - @typescript-eslint plugins to ~5.22.0

* Fix broken test because of class property node type changes. Improve test a bit
to also verifying error line and column numbers

* Disable @typescript-eslint/no-invalid-this

After upgrading this rule reports more false positives. The following comment on the
github issue suggests that it doesn't work for some callbacks because it is just
a simple rule that doesn't do type analysis.

https://github.com/typescript-eslint/typescript-eslint/issues/3620#issuecomment-876810901

* Fix linter issues after upgrading the plugins in eslint-plugin-azure-sdk. Also upgrade eslint version in the impacted packages
2022-05-17 17:12:50 -07:00
Jeremy Meng 12ec95f519
[engsys] upgrade dependency `glob` to ^8.0.0 (#21905)
- for eslint-plugin-azure-sdk and service-bus
- remove unused `glob` dependencies from core-http
2022-05-17 11:49:06 -07:00
Jeremy Meng 68921a94f9
[engsys] upgrade `puppeteer` dev dependency to ^14.0.0 (#21837) 2022-05-12 11:57:03 -07:00
Jeremy Meng daad8968e6
[Service Bus] add an option to omit message body when peeking messages (#21002)
Add an optional `omitMessageBody` option in `PeekMessagesOptions` allowing omitting message body when peeking messages. By default, message body is not omitted.
2022-05-11 16:30:37 -07:00
Timo van Veenendaal cf19b7b0d0
[Perf] Multicore support (#20736)
The perf framework previously did not support true multi-core operation. This PR provides an implementation of multicore support based on a message-passing model.

Two new options are added to the perf framework as part of this PR:
* `--cpus`/`-c`: number specifying the number of cores (CPUs) to use. Defaults to 1, set to 0 to match the number of cores on the machine.
* `--use-worker-threads`: boolean, defaults to false. Pass this flag to use `worker_threads` instead of `child_process` for multithreading (see Multithreading implementations, below)
2022-05-11 12:02:29 -07:00
Azure SDK Bot 8d01288c8e
Post release automated changes for azure-service-bus (#21804) 2022-05-10 16:01:30 -07:00
Azure SDK Bot 54ce7240f5
Post release automated changes for servicebus releases (#21755)
Post release automated changes for azure-arm-servicebus
2022-05-07 00:57:17 +00:00
Jeremy Meng 31173054fe
[ServiceBus] add custom endpoint support (#21698)
* [ServiceBus] add custom endpoint support

- Port changes from Event Hubs. Most of work was done in core-amqp. This PR just
needs to connect the client options with the underlying connection context.

* Fix linter error

* format and build

* Address CR feedback
2022-05-06 13:00:36 -07:00
colawwj 4f1912652b
refresh-16 (#21705)
* refresh-16

* update

* update version
2022-05-05 17:10:06 +08:00
Jeremy Meng f8cd9633c1
[ServiceBus][Test] fix tracing test (#21646)
after core-rest-pipeline moved to core-tracing 1.0.0
2022-04-27 17:12:45 -07:00
Jeremy Meng 3235575a2f
[engsys] upgrade typescript to v4.6 - part.2 (#21537)
* [engsys] upgrade typescript to v4.6 - part.2

- upgrade packages that are maintained by the JS team (i to t)
2022-04-25 16:45:10 -07:00
praveenkuttappan 84329dd2e8 Pin API-extrator to 7.18.11 2022-04-20 15:32:34 -07:00
Jeremy Meng 191e4ce330 [EngSys] prepare for upgrading TypeScript to v4.6
Before upgrading we want to address the breaking change of catch variable now
defaulting to `unkown` by explicitly specify `: any` for implicit `any` catch
variables in our code base.

This commit applies the result of running the following codemod (credit: Maor)

```ts
import { API, FileInfo } from "jscodeshift";
export default function transformer(file: FileInfo, api: API) {
  const j = api.jscodeshift;
  const code = j(file.source);
  code
    .find(j.CatchClause)
    .filter(({ node }) => {
      return node.param && node.param.type == "Identifier" && !node.param.typeAnnotation;
    })
    .forEach(({ node }) => {
      if (node.param.type == "Identifier") {
        node.param.typeAnnotation = j.tsTypeAnnotation(j.tsAnyKeyword());
      }
    });
  return code.toSource();
}
```
2022-04-19 12:11:57 -07:00
Matthew Podwysocki dbc49d5c17
Updating Long from 4 to 5.2 (#21208) 2022-04-18 11:31:59 -07:00
Jeremy Meng dfdcaf6956
[docs][messaging] add comments about browser polyfills (#21357) 2022-04-15 10:20:15 -07:00
Jeff Fisher 58ff11dd07
[core-util] GA library and adopt in core-rest-pipeline (#21352)
GA `@azure/core-util` and expose new helpers
2022-04-13 11:59:33 -07:00
Matthew Podwysocki 2230ad9cc7
[core] Remove @azure/core-asynciterator-polyfill usage (#21290)
* Remove @azure/core-asynciterator-polyfill usage

* Remove @azure/core-asynciterator-polyfill usage

* Remove from workspace too

* Remove from core artifacts list

* Make eslint happy

* Fix more eslint errors

Co-authored-by: Jeremy Meng <yumeng@microsoft.com>
2022-04-11 14:17:23 -07:00
Jeremy Meng f491ef5ebb
[ServiceBus][Test] Add error tolerance when check for retry delay (#21134)
The log shows that when the test failed, the wait time is 1999 ms, close but
less than the expected 2000 ms. I suspect it is related to precision.

This PR allows some tolerance when checking the delay.
2022-03-31 14:23:05 -07:00
Jeremy Meng 2aae404763
[ServiceBus] prepare for April 2022 releasse (#21129) 2022-03-31 11:00:13 -07:00
Will Temple af2317e3c3 Use azure-samples 2022-03-24 14:03:30 -04:00
Will Temple da364c71ce [samples] Moved sample package names to namespace @azure-samples 2022-03-24 13:35:48 -04:00
Jeremy Meng f58ac8ae6f
[ServiceBus][test] log more diagnostic information (#20986)
* log more information to help diagnose test failure in issue #20963.

* Update sdk/servicebus/service-bus/test/internal/unit/receiverCommon.spec.ts

Co-authored-by: Deyaaeldeen Almahallawi <dealmaha@microsoft.com>
2022-03-23 17:27:09 +00:00
Harsha Nalluru efe321c061
[Perf] [Service Bus] [Event Hubs] Event Based SDKs Perf Framework - part 2 (#18859)
* clean up old scripts

* tests -> perfTest

* base, event, batch perf test classes

* program.ts

* incorrect comment

* postSetup and preCleanup

* ParsedPerfOptions<TOptions = Record<string, unknown>> and related updates

* remove ! from options

* MockReceiverTest

* import "@azure/abort-controller" at perf classes

* BatchReceiveTest

* remove !

* changelog

* receiveBatch test

* remove aborter

* docs

* BatchSendTest

* receiveMessages

* no need of timer

* - Adds `PerfTestBase` and `BatchPerfTest`.

* lint fixes

* checkpoitn

* checkpoint

* manage parallels in base class

* parallels in base class

* MockEventReceiverTest and the framework

* fix readme

* formatting

* unneeded changes

* EventPerfTest

* mock test

* subscribe test for service-bus

* lint error

* formatting

* simplify

* update desc

* checkpoint

* subscribe-test

* mock event receiver 2

* formatting

* Address Mike's feedback

* lint format

* remove min-max delay

* maxEventsPerSecond logic

* Apply suggestions from code review

* Make EventPerfTest.eventRaise() and errorRaised() sync instead of async
- Methods do not perform any async work, and sync methods add less overhead to perf framework

* Cache event arrays to increase MockEventHubConsumerClient throughput

* Add MockReceiverTest to test list

* Improve throughput of MockReceiverTest
- Now matches NoOpTest * AverageBatchSize
- Also update options to match .NET

* Jeremy's feedback

* Clear the duration timer if the test ended sooner

* Mike's feedbakc

* lint:fix

* minor feedback

Co-authored-by: Mike Harder <mharder@microsoft.com>
2022-03-21 19:42:30 +00:00
Maor Leger 8d5a1b250b
[engSys] - Upgrade puppeteer (#20782)
### Issues associated with this PR
Resolves #19234 

### Describe the problem that is addressed by this PR
Upgrades puppeteer to the latest version

### What are the possible designs available to address the problem? If there are more than one possible design, why was the one in this PR chosen?
I looked through the changelog for puppeteer and did not see any major changes between 10 and 13 that should impact us
2022-03-11 12:02:20 -08:00
Jeremy Meng 4eec65d161
[ServiceBus] correct types for `propertiesToModify` options (#20577)
We claim that we can take `any` type of property values for properties to be
modified but it's `applicationProperties` part of a Service Bus message that is
modified. That property has a type of `number | boolean | string | Date | null`
and is what the service supports.

This PR corrects the types for these options to align with
`applicationProperties`. Even though it shows as a breaking change, other
unsupported types (e.g., an object literal) would cause service errors so they
never worked.
2022-03-11 09:52:36 -08:00
Jeremy Meng 0555acbc4c
[ServiceBus] Migrate REST-based client to core-rest-pipeline (#19587)
* Move to depend on core v2 libraries.

* Previously WebResourceLike.body is of type any so we were able to assign an object to it, then relies on the internal logic in
`executeAtomXmlOperation()` to stringify it to XML before sending the request. Now that `PipelineRequest.body` is strongly typed, `executeAtomXmlOperation()` is
updated to optionally take the strongly typed request objects for PUT
operations.

* Add a compatibility layer to transform PipelineResponse to HttpResponse like by copying most relevant properties of `WebResourceLike` and add copy of `HttpResponse`

* Bump version

* Stop verifying AbortError error message. It turns out that we now have a different error message after switching to Fetch
http client for browser. Previously we were catching the one from xhrHttpClient
but now we get a DOMException from browser.  As error message isn't part of
public Api surface, the verification of error message is removed.
2022-03-09 21:24:29 +00:00
Jeremy Meng aee2b7f2b8
[ServiceBus] Prepare for 2022 March release (#20636)
- update CHANGELOG
2022-03-02 22:12:26 -05:00
colawwj 921810a62b
Separate ci.yml and ci.mgmt.yml (#20354) 2022-02-18 10:28:11 +08:00
Jeremy Meng a0fce6919d
[ServiceBus] Respect user request to close receiver when disconnected (#20427)
When receiving messages in a stream using `receiver.subscribe()`, 
Under certain situation when the underlying connection is closed, we don't respect user request to close the receiver, but keep retrying to recover.

The problem is that we check the connection status and throw an error if it is closed in
`_initAndAddCreditOperation`.  We restart retry cycle because of the error in the
`retryForEver()` function with the same operation, trying to re-establish the connection, then throw the same error again.
User calling `close()` wouldn't help because the place we
check for suspended state then throw `AbortError` is after we check the
connection and throw error.

This PR adds the checking of whether user has suspended the receiver before checking of connection so we
could throw `AbortError` to end the retry cycles.  The check after `preInitialize()` invocation is still needed
as user could suspend us in the `preInitialize()` handler.

I also fix another issue of not respecting 0 values in user specified retry options.

### Packages impacted by this PR

@azure/service-bus

### Issues associated with this PR

#20388
2022-02-17 14:43:56 -08:00
Jeremy Meng bd4b77b15f
[Test] Reduce some live tests time out limit (#20394)
- Service Bus and Event Hubs live tests used to take much longer time to run but we have
improved significantly since then.

- AppConfig live tests usually finish under 30 minutes.
2022-02-15 14:11:13 -08:00
Azure SDK Bot 58318da286
Post release automated changes for azure-service-bus (#20365) 2022-02-14 19:11:24 +00:00
Jeremy Meng d5e4636c91
[ServiceBus] add delay between infinite retry cycles (#20316)
* [ServiceBus] add delay between infinite retry cycles

Errors that are not retryable will be re-thrown out of the normal retry() call.
However, we don't have any delay before restarting the retry cycle.

This PR adds a delay before continuing the infinite retry cycles.

* Add a test and update changelog

also fixed the issue where we don't use `maxRetryDelayInMs` in Fixed retry
mode.

* Address CR feedback

* Update sdk/servicebus/service-bus/CHANGELOG.md

Co-authored-by: Ramya Rao <ramya.rao.a@outlook.com>

* Revert max delay limit in Fixed retry mode

as the setting only applies to Exponential retry mode.

Co-authored-by: Ramya Rao <ramya.rao.a@outlook.com>
2022-02-11 18:11:22 -08:00
Wenjie Yu(MSFT) f9f36200d5
Update service bus to enable live testing in sovereign clouds for multiple services (#20248) 2022-02-09 10:06:12 -08:00
Jeremy Meng 6be39472ec
[ServiceBus] Prepare for February 2022 release (#20239)
* update version number
* update CHANGLOG
2022-02-07 17:10:25 -08:00
Jeremy Meng 2b2b9a4b52
[ServiceBus] Fix an issue where user error handler is not called (#19189)
when subscribing to a valid topic but an invalid or disabled subscription. Issue https://github.com/Azure/azure-sdk-for-js/issues/18798

The problem is that in these cases, the service accepts our client's cbs claim negotiation, and the receiver link is
created. The [client receiver enters](14099039a8/sdk/servicebus/service-bus/src/core/streamingReceiver.ts (L539))
the `retryForeverFn` to call `_initAndAddCreditOperation()`, where the following

```ts
  await this._messageHandlers().postInitialize();
  this._receiverHelper.addCredit(this.maxConcurrentCalls);
```

will return successfully, despite that the fired-and-forgot `addCredit()` call would later leads to
`MessagingEntityDisabled` or `MessagingEntityNotFound` errors in the underlying link. Since there's no errors thrown in
our retry-forever loop, the `onErrors()` [callback](14099039a8/sdk/servicebus/service-bus/src/core/streamingReceiver.ts (L541))
is not invoked. It is one place where the user error handler is called.

Because of the error, the link is detatched. We have code to re-establish the link when errors happen, so we call
`_subscribeImpl()` where the `retryForeverFn()` is called again. This goes on in an endless loop.

We used to invoke user error handler and would not attempt to re-establish connections when errors are considered
non-retryable. In PR #11973 we removed the classification of errors that `subscribe()` used and instead continues to
retry infinitely. We also removed the code to invoke user error handler. This PR adds code to invoke the user error
handler in `_onAmqpError()` so users have a chance to stop the infinite loop.

There's another problem. When users call `close()` on the subscription in their error handler,
`this._receiverHelper.suspend()` is called to suspend the receiver. However, when re-connecting we call
`this._receiverHelper.resume()` again in `_subscribeImpl()`. This essentially reset the receiver to be active and we
will not abort the attempt to initialize connection

14099039a8/sdk/servicebus/service-bus/src/core/streamingReceiver.ts (L574-L579)

To fix it, this PR moves the `resume()` call out. It is supposed to only called to enable receiver before
subscribing. It should not be called when we try to re-connect.

* Update ref doc on the receiver subscribe error handler

* Apply suggestions from code review

Co-authored-by: Ramya Rao <ramya.rao.a@outlook.com>

* Bring back processError() call in _onSessionError() callback

* Clarify that we retry on all errors when streaming

and link to ref doc on service bus errors.

* Bring back comments for resume() call

Also fix linting issue. The linter insists "@" in ts-doc should be escaped.

The url still works after adding "\"

* Re-remove comments

Co-authored-by: Ramya Rao <ramya.rao.a@outlook.com>
2022-02-07 11:10:09 -08:00
Jeremy Meng 35757be24f
[core-amqp] set the max listener limit to 1000 for sender and receiver (#20088)
NodeJS would issue warning if the number of disconnected listeners on an event
emitter exceeds 10. When many sessions on a connection are closed but the
removal of the listener hasn't caught up, we will see this warning because the
default limit of 10 in NodeJS is too low. The disconnected listeners DO get
removed eventually in our code.

We already do this for senders created in Service Bus. This PR increase the
limit to 1000 for senders and receivers created off
`ConnectionContextBase.connection` so that the limites apply to both Service Bus
and Event Hubs.

* EH and SB no longer need to set max listener limit.

For Issue https://github.com/Azure/azure-sdk-for-js/issues/12161
2022-02-01 17:45:43 -08:00
Will Temple 212f4f4456 Squashed commit of the following:
commit dcb5df3fc8
Merge: 356a32c63 6739271b8
Author: Will Temple <witemple@microsoft.com>
Date:   Fri Jan 28 17:22:23 2022 -0500

    Merge remote-tracking branch 'upstream/main' into witemple-msft/rollup2

commit 356a32c63f
Merge: 6527b2813 b88c0bae2
Author: Will Temple <witemple@microsoft.com>
Date:   Fri Jan 28 16:51:32 2022 -0500

    Merge remote-tracking branch 'upstream/main' into witemple-msft/rollup2

commit 6527b2813f
Merge: db7197b84 55ad30951
Author: Will Temple <witemple@microsoft.com>
Date:   Fri Jan 28 16:13:56 2022 -0500

    Merge remote-tracking branch 'upstream/main' into witemple-msft/rollup2

commit db7197b84b
Author: Will Temple <witemple@microsoft.com>
Date:   Fri Jan 28 11:03:50 2022 -0500

    Enable communication-phone-numbers browser tests

commit 9336dc195f
Merge: 097c9d2bc 7ea04a838
Author: Will Temple <witemple@microsoft.com>
Date:   Thu Jan 27 16:17:54 2022 -0500

    Merge branch 'witemple-msft/rollup2' of github.com:Azure/azure-sdk-for-js into witemple-msft/rollup2

commit 097c9d2bc5
Merge: a022f51bd 9ef90e433
Author: Will Temple <witemple@microsoft.com>
Date:   Thu Jan 27 16:17:29 2022 -0500

    Merge remote-tracking branch 'upstream/main' into witemple-msft/rollup2

commit 7ea04a8388
Author: Will Temple <witemple@microsoft.com>
Date:   Wed Jan 26 17:00:14 2022 -0500

    Update common/tools/dev-tool/src/config/rollup.base.config.ts

    Co-authored-by: Harsha Nalluru <sanallur@microsoft.com>

commit a022f51bde
Merge: 64599af3a c7024562e
Author: Will Temple <witemple@microsoft.com>
Date:   Wed Jan 26 16:42:10 2022 -0500

    Merge remote-tracking branch 'upstream/main' into witemple-msft/rollup2

commit 64599af3a3
Merge: bdd4bcac1 0c4d2af1f
Author: Will Temple <witemple@microsoft.com>
Date:   Tue Jan 25 17:29:58 2022 -0500

    Merge remote-tracking branch 'upstream/main' into witemple-msft/rollup2

commit bdd4bcac15
Merge: e834674c9 97b77df56
Author: Will Temple <witemple@microsoft.com>
Date:   Tue Jan 25 11:26:58 2022 -0800

    Merge remote-tracking branch 'upstream/main' into witemple-msft/rollup2

commit e834674c93
Author: Will Temple <witemple@microsoft.com>
Date:   Tue Jan 25 11:19:29 2022 -0800

    fixed schema-registry-avro

commit 26425ecf4c
Author: Will Temple <witemple@microsoft.com>
Date:   Mon Jan 24 12:53:58 2022 -0800

    Remove util dependency from monitor-query

commit 50beb01555
Author: Will Temple <witemple@microsoft.com>
Date:   Mon Jan 24 14:36:30 2022 -0500

    Removed dangling 'util' dependency

commit d28baf05e5
Author: Will Temple <witemple@microsoft.com>
Date:   Mon Jan 24 12:38:56 2022 -0500

    Make warning inhibitors work on Windows

commit 5c4c828a10
Author: Will Temple <witemple@microsoft.com>
Date:   Mon Jan 24 08:31:07 2022 -0800

    Fixed recorder build:test

commit 81a9d6d65b
Merge: cc7f21248 2144ad4eb
Author: Will Temple <witemple@microsoft.com>
Date:   Fri Jan 21 15:16:24 2022 -0800

    Merge remote-tracking branch 'upstream/main' into witemple-msft/rollup2

commit cc7f212480
Author: Will Temple <witemple@microsoft.com>
Date:   Fri Jan 21 15:16:08 2022 -0800

    iot-device-update-rest: migrated

commit 88212d2d80
Author: Will Temple <witemple@microsoft.com>
Date:   Fri Jan 21 14:13:51 2022 -0800

    keyvault-keys: disable node polyfill

commit 3c1302b09a
Author: Will Temple <witemple@microsoft.com>
Date:   Fri Jan 21 14:10:17 2022 -0800

    keyvault-admin: disabled browser node polyfill

commit 818cf063c2
Author: Will Temple <witemple@microsoft.com>
Date:   Fri Jan 21 13:35:29 2022 -0800

    Add basePath configuration to shared script config, inhibit empty warnings from node-resolve

commit 8d187890fe
Author: Will Temple <witemple@microsoft.com>
Date:   Fri Jan 21 12:15:58 2022 -0800

    Removed errant rollup.config.js entries

commit d4833d4914
Author: Will Temple <witemple@microsoft.com>
Date:   Fri Jan 21 11:47:45 2022 -0800

    Remove my launch config

commit e63d4e5163
Merge: 37cb4bcf5 d9fe26483
Author: Will Temple <witemple@microsoft.com>
Date:   Fri Jan 21 11:45:31 2022 -0800

    Merge remote-tracking branch 'upstream/main' into witemple-msft/rollup2

commit 37cb4bcf56
Author: Will Temple <witemple@microsoft.com>
Date:   Fri Jan 21 11:44:20 2022 -0800

    Added shim plugin for source maps

commit 98579cc73f
Merge: 9132065dc e3db6c418
Author: Will Temple <witemple@microsoft.com>
Date:   Thu Jan 20 09:44:42 2022 -0800

    Merge remote-tracking branch 'upstream/main' into witemple-msft/rollup2

commit 9132065dc2
Author: Will Temple <witemple@microsoft.com>
Date:   Fri Jan 14 14:39:32 2022 -0500

    Changed weird regex to path.split.join

commit 9c20ebb570
Author: Will Temple <witemple@microsoft.com>
Date:   Thu Jan 13 17:25:21 2022 -0500

    Removed communication-chat browser test config, as it's not needed

commit 2a8364d387
Author: Will Temple <witemple@microsoft.com>
Date:   Thu Jan 13 17:06:02 2022 -0500

    Deleted rollup.config.js for packages on the shared script.

commit 3fc9575933
Author: Will Temple <witemple@microsoft.com>
Date:   Thu Jan 13 17:01:31 2022 -0500

    template: removed rollup

commit 85d7050081
Author: Will Temple <witemple@microsoft.com>
Date:   Thu Jan 13 16:54:55 2022 -0500

    synapse: silence rollup output

commit ae9f7a6acb
Author: Will Temple <witemple@microsoft.com>
Date:   Thu Jan 13 16:30:53 2022 -0500

    Some updates to the bundle command

commit 11cee51f6a
Author: Will Temple <witemple@microsoft.com>
Date:   Thu Jan 13 16:30:33 2022 -0500

    Migrate more packages to shared rollup script

commit 0c4d89c8f4
Merge: f1ccb033a 78f849db7
Author: Will Temple <witemple@microsoft.com>
Date:   Thu Jan 13 13:00:13 2022 -0500

    Merge remote-tracking branch 'upstream/main' into dev-tool/rollup2

commit f1ccb033ab
Author: Will Temple <witemple@microsoft.com>
Date:   Thu Jan 13 12:11:27 2022 -0500

    [dev-tool] Add rollup-plugin-polyfill-node

commit 1a8ec9b1a2
Author: Will Temple <witemple@microsoft.com>
Date:   Wed Jan 12 19:07:43 2022 -0500

    preferBuiltins: false for browser

commit fe81f4ce0c
Author: Will Temple <witemple@microsoft.com>
Date:   Wed Jan 12 18:20:38 2022 -0500

    arm-compute: fix new warning

commit a75eca0064
Author: Will Temple <witemple@microsoft.com>
Date:   Wed Jan 12 16:20:54 2022 -0500

    Fixed build error in dev-tool

commit d890a897fd
Author: Will Temple <witemple@microsoft.com>
Date:   Wed Jan 12 16:18:36 2022 -0500

    Resoved merge conflict

commit a64fa41b34
Author: Will Temple <witemple@microsoft.com>
Date:   Wed Jan 12 16:12:16 2022 -0500

    Remove mixed rollup commands, leaving only rollup.test.config.js

commit f159571fd0
Author: Will Temple <witemple@microsoft.com>
Date:   Wed Jan 12 14:43:55 2022 -0500

    Remove all rollup dependencies

commit 65170145b1
Author: Will Temple <witemple@microsoft.com>
Date:   Wed Jan 12 14:11:28 2022 -0500

    Remove ordinary rollup commands.

commit f43cc70494
Author: Will Temple <witemple@microsoft.com>
Date:   Wed Jan 12 12:48:19 2022 -0500

    Removed configs that opt-out of browser bundles

commit 24357be603
Merge: 86250f0ab 20df85cb7
Author: Will Temple <witemple@microsoft.com>
Date:   Wed Jan 12 12:31:49 2022 -0500

    Merge remote-tracking branch 'upstream/main' into dev-tool/rollup2

commit 86250f0ab2
Merge: 26c241e6a 8dcc09499
Author: Will Temple <witemple@microsoft.com>
Date:   Wed Jan 12 12:27:43 2022 -0500

    Merge remote-tracking branch 'upstream/main' into dev-tool/rollup2

commit 26c241e6ac
Merge: a0a98eeba 12b194101
Author: Will Temple <witemple@microsoft.com>
Date:   Tue Dec 14 18:37:30 2021 -0500

    Merge remote-tracking branch 'upstream/main' into dev-tool/rollup2

commit a0a98eeba2
Author: Will Temple <witemple@microsoft.com>
Date:   Tue Dec 14 17:39:12 2021 -0500

    Make consistent

commit c8f6ffeb3f
Author: Will Temple <witemple@microsoft.com>
Date:   Tue Dec 14 17:29:05 2021 -0500

    Migrate template

commit d56bcc5e4b
Author: Will Temple <witemple@microsoft.com>
Date:   Wed Dec 8 11:46:16 2021 -0500

    [dev-tool] Add "bundle" command
2022-01-28 17:26:28 -05:00
Timo van Veenendaal 99f2b37542
[Perf tests/service-bus-track-1] Add batch receive perf tests for Service Bus Track 1 (#19790)
**Packages impacted by this PR:**

- `@azure-tests/perf-service-bus-track-1`

**Issues associated with this PR:**

- #18982

**Describe the problem that is addressed by this PR:**

Add a test for receiveBatch using the track 1 service bus SDK in line with what we already have for the track 2 SDK

**Provide a list of related PRs** _(if any)_
- #18811
2022-01-20 14:35:57 -08:00
Maor Leger b200156b18
[eventgrid][servicebus] - Update tests to reflect tracingPolicy changes (#19893)
**Checklists** 
- [x] Added impacted package name to the issue description

**Packages impacted by this PR:** 
@azure/event-grid, @azure/service-bus

**Describe the problem that is addressed by this PR:**
In order to conform to the OTel spec and allow for easier aggregations we
updated tracing policy to name the span `HTTP <method>` instead of `<path>`.
Unfortunately we missed a few tests, so this updates those tests to reflect the
core changes.

While editing these tests, I realized I never added CHANGELOG entries for the original
change. This PR addresses that as well.

**Provide a list of related PRs**_(if any)_
#19838

Resolves #19887
Resolves #19885
2022-01-18 11:29:38 -08:00
Deyaaeldeen Almahallawi 0288d65afa
Upgrade downlevel-dts to latest (#19762) 2022-01-11 20:00:46 +00:00
Jonathan Cárdenas c317dba91e
Update prettier dev-dependency to v2.5.1 in Service Bus (#19576)
* Update prettier version

* Format files

* Format perf-tests
2022-01-03 18:33:37 -06:00
Harsha Nalluru dc8b6da618
[Recorder] Manipulate the `retry-after` header to have "0" value for playback (#19501)
* base code

* 'Retry-After',
  '0',

  manual replacements

* setDefaultRetryAfterIntervalInNockFixture

* setDefaultRetryAfterIntervalInNockFixture

* changelog

* changelog

* docs

* docs

* 19501

* Update sdk/test-utils/recorder/test/node/utils.spec.ts

* Format

* Update recordings to have retry-after value of 0

and remove some 202 responses

Co-authored-by: Jeremy Meng <yumeng@microsoft.com>
2022-01-03 23:31:35 +00:00
Jeremy Meng 479234a3a6
[ServiceBus][Test] Fix Min-Max test build failure (#19600)
* [ServiceBus][Test] Fix Min-Max test build failure

With `@types/long` min version of `4.0.0` we got compilation error

```
Namespace 'Long' has no exported member 'Long'.
```

version `4.0.1` fixes this.

* Update version for event hubs too
2021-12-30 17:06:50 -08:00
Jeremy Meng 61528a2afb
[ServiceBus][TestReliability] Increase timeout when expecting an error (#19509)
for non-existing queue.

When this test is running on China Cloud on a Mac build agent, it gets the
expected error except that it takes a little more than 3 seconds for the error
to come back.

This PR increases the timeout to 5 seconds.
2021-12-27 11:17:52 -08:00
Jeremy Meng 1f237f2493
[ServiceBus][Test] fix unstable tests that verify message state (#19357)
* [ServiceBus][Test] fix unstable tests that verify message state

The test messages we create have `scheduledEnqueueTimeUtc` set. Most of the time
messages received from the service have "active" state, but occasionally have
"scheduled" state due to the set property, thus failing the assertion.

This PR updates the check to check for either "active" or "schedule". In
addition, a test is added for "active" state where the `scheduledEnqueueTimeUtc`
property is removed before sending the message.

Also shown in the failing pipeline that when the test failed, the message wasn't
removed because `receiver.completeMessage()` is not called. The lingering
message caused the next test to fail. While updating the tests I also moved the
cleanup step before assertions so the message should always be removed.

* Undo changes to pipeline

* Address CR feedback

* Disable linting rule

* Remove an unstable assertion on message state.
2021-12-17 20:25:09 +00:00
Ramya Rao 986a28c8d9
Update version for ws (#19382)
Resolves #17075

This PR updates the version of ws from v7 to v8
The breaking changes in the changelog do not affect the way we use it. See https://github.com/websockets/ws/releases/tag/8.0.0
Chose to go with `^8.2.0` to match the version being used by `@azure/web-pubsub`
2021-12-15 23:53:46 +00:00
Azure SDK Bot cbc5e30876
Post release automated changes for azure-arm-servicebus (#19375) 2021-12-15 15:51:06 -08:00
colawwj 7cb905343a
servicebus-track2-ga (#19316) 2021-12-15 12:10:23 +08:00
Ramya Rao 91e3627b7f
Update mocha-junit-reporter (#19309)
* Update mocha-junit-reporter

* rush update
2021-12-14 09:05:13 -08:00
Ramya Rao 5deb6ced31
Remove the docs script from packages (#19307)
As discussed in #17076, we no longer have the need for the `docs` script in each of our packages. This PR removes this script and the related dev dependency on typedoc
2021-12-14 01:30:46 +00:00
Ramya Rao 6c12ef4659
Update nyc to v15 (#19248)
This PR makes the following updates regarding the `nyc` dependency
- Update to v15 from v14 across all packages
- Updates to `@azure/monitor-opentelemetry-exporter` as it failed to run the tests with the updated nyc. 
     - Update the test scripts to use the js files in the dist-esm folder like all other packages instead of using the ts-node plugin.
     - Update one of the tests for `@azure/monitor-opentelemetry-exporter` to use the right path for package.json file now that the tests are being run from the dist-esm folder.

Random set of live tests were triggered from this PR to ensure that nyc works as expected.
The failure for data-tables is an unrelated service side issue

Resolves #19232
2021-12-13 23:43:51 +00:00
Maor Leger ef16743361
[service-bus / eventhubs] - Fix browser tests (#19244)
## What

- Patch service-bus and event-hubs' rollup config with custom plugins that are required for test runs
- Replace `assert` with `chai`

## Why

We tried to use the shared rollup config across packages but unfortunately service-bus event-hubs are and will likely remain a special case due to the various dependencies it pulls in. We identified a few fixable issues but there are some
that will not be easily resolved.

So, working with Will we decided a reasonable compromise is to use the shared config but patch the plugins so that they
match what they were before the recent changes.

In passing, I am also removing any imports of the `assert` module as that has been removed and the tests are failing. So 
this should fix that as well.
2021-12-11 16:55:14 -08:00
Jeremy Meng 3bdb490edd
[ServiceBus] Add optional boolean `skipParsingBodyAsJson` option (#18692)
* [ServiceBus] Add optional boolean `skipParsingBodyAsJson` option

to `ReceiveMessagesOptions`, `SubscribeOptions`, and
`ServiceBusSessionReceiverOptions`. This allows users to control whether the SDK
should skip parsing message body as Json object. By default the SDK will attempt
parsing message body as Json object.

While updating code, I also fixed sample unit test which is using out-dated
paths thus not finding any sample code files, and removed two `await` that are
redundant.

Resolves #18630

* Add optional `skipParsingBodyAsJson` boolean property

to `ServiceBusReceiverOptions` and remove those on `ReceiveMessagesOptions` and
`SubscribeOptions`

* Remove commented code that was trying to decode again

but the message body is already decoded, and _rawAmqpMessage is assigned in
`fromRheaMessage()`

* Remove double decoding

message.body has been decoded already above by `fromRheaMessage()` call.

* Update CHANGELOG and package version

* Add comments

* Update sdk/servicebus/service-bus/CHANGELOG.md

Co-authored-by: Deyaaeldeen Almahallawi <dealmaha@microsoft.com>

Co-authored-by: Deyaaeldeen Almahallawi <dealmaha@microsoft.com>
2021-12-10 19:10:46 +00:00
Ramya Rao ec74a37f22
Avoid pointing to docs that are misleading about API deprecation (#19081) 2021-12-09 22:19:14 -08:00
Maor Leger 3c97db3a18
[rollup] - Fix bug in circular dependency warning suppression (#19012)
## What

- Fix incorrect logic when suppressing chai's circular dependency warnings
- Move to the common dev-tool configuration where possible

## Why

This is a longstanding issue that we have, where an incorrect logic was copy-pasted to other places. I figured while cleaning this up that any package I touch can just convert over to the shared dev-tool configuration. Where I was unable
to do that, I just fixed this bug to avoid too many changes in one PR.

Fixes #14292
Resolves #17818 
Resolves #17816 
Resolves #17815 
Resolves #17814 
Resolves #17813 
Resolves #17810
2021-12-09 11:00:32 -08:00
Jeremy Meng b7638dcaf4
[ServiceBus] add `state` property to `ServiceBusReceivedMessage` (#18938)
It can be one of the three `ServiceBusMessageState` values: `"active"`, `"deferred"`, or `"scheduled"`.

Several tests are updated to verify the message state property.
2021-12-06 16:27:57 -08:00
Harsha Nalluru 46164b919c
[Perf Framework] BatchPerfTest & Service Bus Receive Batch perf test (#18811)
* clean up old scripts

* tests -> perfTest

* base, event, batch perf test classes

* program.ts

* incorrect comment

* postSetup and preCleanup

* ParsedPerfOptions<TOptions = Record<string, unknown>> and related updates

* remove ! from options

* MockReceiverTest

* import "@azure/abort-controller" at perf classes

* BatchReceiveTest

* remove !

* changelog

* receiveBatch test

* remove aborter

* docs

* BatchSendTest

* receiveMessages

* no need of timer

* - Adds `PerfTestBase` and `BatchPerfTest`.

* lint fixes

* format

* remove unnneded abstract duplicates

* Update sdk/servicebus/perf-tests/service-bus/test/receiveBatch.spec.ts

Co-authored-by: Daniel Rodríguez <sadasant@users.noreply.github.com>

* Update sdk/servicebus/perf-tests/service-bus/test/receiveBatch.spec.ts

Co-authored-by: Daniel Rodríguez <sadasant@users.noreply.github.com>

* Update sdk/test-utils/perf/CHANGELOG.md

Co-authored-by: Daniel Rodríguez <sadasant@users.noreply.github.com>

* Update sdk/test-utils/perf/CHANGELOG.md

Co-authored-by: Daniel Rodríguez <sadasant@users.noreply.github.com>

* Update sdk/test-utils/perf/CHANGELOG.md

Co-authored-by: Daniel Rodríguez <sadasant@users.noreply.github.com>

* Update sdk/test-utils/perf/CHANGELOG.md

Co-authored-by: Daniel Rodríguez <sadasant@users.noreply.github.com>

* Update sdk/test-utils/perf/src/batchPerfTest.ts

Co-authored-by: Daniel Rodríguez <sadasant@users.noreply.github.com>

* Update sdk/test-utils/perf/src/options.ts

Co-authored-by: Daniel Rodríguez <sadasant@users.noreply.github.com>

* Update sdk/test-utils/perf/src/perfTest.ts

Co-authored-by: Daniel Rodríguez <sadasant@users.noreply.github.com>

* Update sdk/test-utils/perf/src/perfTest.ts

Co-authored-by: Daniel Rodríguez <sadasant@users.noreply.github.com>

* just a comment

* just a comment

* more comments

* stylize

* better Type

* SBTest extends BatchPerfTest

* run the tests with this command

Co-authored-by: Daniel Rodríguez <sadasant@users.noreply.github.com>
2021-12-06 15:10:18 -08:00
Jonathan Cárdenas 8f37a2d9e9
Remove assert dev dependency (#18935) 2021-12-02 19:14:30 -08:00
Ben Broderick Phillips 595c4c8c8b
[stress, servicebus] Update dependency version. Remove/rename old deployment files (#18929) 2021-12-02 19:28:21 -05:00
Harsha Nalluru b3838aa0dd
[Stress Tests] error as Error - Fix build failure (#18911)
* error as Error

* exception instanceof Error

* missed it!
2021-12-02 01:34:48 +00:00
Jeremy Meng 035fa8a8d9
[ServiceBus] Fix linter errors and enable linting (#18670)
* [ServiceBus] Enable linting

* Fixing most linting errors in tests

* Fix more linting errors in src

* Disable errors

- for namespace
- parameter of `any`

* make key const and value mutable

* Add `.catch()` block for promise

* address CR feedback

* format

* Delete test input of undefined ruleOptions for createRule() test

* Use different overloads of `crateRule()`

* Update to the new rule name

* in browser, the error caught doesn't have message property!

AssertionError: expecting valid error.message but error is [object CloseEvent]: expected undefined to be truthy
2021-11-25 00:20:22 +00:00
Azure SDK Bot 12459180d3
Post release automated changes for azure-service-bus (#18613) 2021-11-10 00:07:48 +00:00
Harsha Nalluru 7c0b67c307
[Service Bus] Releasing 7.4.0 (#18577) 2021-11-09 19:33:45 +00:00
Jeremy Meng 8752bcfca4
[ServiceBus] Use `Promise.all()` when closing connection context. (#18371)
* Use `Promise.all()` when closing connection context so that closing requests are fired immediately.

* Add CHANGELOG entry
2021-11-04 17:36:40 -07:00
Ramya Rao 727b2e00fc
Remove dependency overrides for Identity (#18474)
Related to #14581

In https://github.com/Azure/azure-sdk-for-js/pull/18463, we updated all samples to use GA of Identity v2
In https://github.com/Azure/azure-sdk-for-js/pull/18470, we updated devDependencies of Identity v2 beta to use Identity v2 GA

This PR removes the dependency overrides put in place for the reason (am guessing) that we wanted tests to use the beta v2 Identity, but not samples

Now that the samples are using v2, we no longer need the dependency overrides
2021-11-01 23:41:57 +00:00
Ramya Rao 8f40cf08d9
Move Identity dependency from v2 beta to v2 GA (#18470) 2021-11-01 15:31:25 -07:00
Ramya Rao 290a6e4d66
Update all samples to use Identity v2 (#18463) 2021-11-01 15:15:54 -07:00
Timo van Veenendaal 7a7d99d271
[Perf Framework] rename perfstress to perf and runAsync to run (#18290)
Reported in #18033.

Basically did a bulk find+replace everywhere. Things _seem_ to be working OK, but wouldn't be surprised if there's something somewhere I've missed, or somewhere where I've replaced something I shouldn't.

I've split the rename of PerfStress -> Perf and runAsync -> run into two commits for ease of review :)
2021-10-23 06:05:56 +00:00
Harsha Nalluru 4cc59c0b2f
[Service Bus] ATOM API - Make service version configurable (#18254)
* ServiceBusAtomAPIVersion

* older API Version is broken

* tests

* rename

* changelog

* getRandomServiceVersion

* remove .only

* address Jeremy's feedback

* serviceVersion comments

* docs

* test with both the api versions

* Donot expose ServiceBusAtomAPIVersion

* test

* doc update
2021-10-21 22:40:16 -07:00
Azure SDK Bot b01fc24700
Post release automated changes for servicebus releases (#18206)
Post release automated changes for azure-arm-servicebus
2021-10-15 09:59:41 +00:00
Hiroshi Yoshioka 1e706fc136
Typo "Typescript"→"TypeScript" (#18141)
https://docs.microsoft.com/en-us/javascript/api/overview/azure/service-bus-readme?view=azure-node-latest
related: "https://github.com/MicrosoftDocs/azure-docs-sdk-node/pull/1287#pullrequestreview-768207375"
@danieljurek  - Thank you for your suggestion.
2021-10-12 10:23:18 -05:00
colawwj ef323b7ffa
track2-version-bump (#18111)
* track2-version-bump

* update

* update
2021-10-09 14:48:41 +08:00
Azure SDK Bot 311a6ac6bd
Post release automated changes for azure-service-bus (#18045) 2021-10-05 19:45:40 +00:00
Harsha Nalluru a8021f568b
[Service Bus] Fix live test failure (#18027)
* changelog

* fix test

* remove .only
2021-10-05 00:33:55 +00:00
Harsha Nalluru c7f39c1754
[Service Bus] Release 7.4.0-beta.1 (#18024)
* changelog

* 7.4.0-beta.1
2021-10-04 23:08:27 +00:00
Harsha Nalluru 0e569b51e1
[Service Bus] Release 7.3.1-beta.1 (#18020) 2021-10-04 15:03:02 -07:00
Harsha Nalluru afff61b21f
[Service Bus] Support MaxMessageSizeInKilobytes (#17953)
* Fix retry handling for Session Not Found errors

* Update sdk/cosmosdb/cosmos/test/internal/session.spec.ts

Co-authored-by: Zachary Foster <zfoster@users.noreply.github.com>

* Update CODEOWNERS for Application Insights (#17055)

* MaxMessageSizeInKilobytes api

* sample,test.env

* API Report

* add tests

* finish the tests

* remove console.log

* arm template

* put .only to test in CI with limited tests

* minor test update

* remove .only, add changelog

* Update sdk/servicebus/service-bus/src/util/constants.ts

Co-authored-by: chradek <51000525+chradek@users.noreply.github.com>

* wrap text - changelog

* maxMessageSizeInKilobytes: 256 by default for Standard namespaces

* Revert "maxMessageSizeInKilobytes: 256 by default for Standard namespaces"

This reverts commit 4f425634b6.

* exclude "maxMessageSizeInKilobytes"

* (Configurable only for Premium Tier Service Bus namespace.)

* Version 7.3.1-beta.1

* update version at more places

* lock file

* Update sdk/servicebus/service-bus/CHANGELOG.md

Co-authored-by: Adam Ling (MSFT) <adam_ling@outlook.com>

* lock file

* non optional in EntityProperties

* api report

Co-authored-by: Steve Faulkner <southpolesteve@gmail.com>
Co-authored-by: Zachary Foster <zfoster@users.noreply.github.com>
Co-authored-by: omziv <80668253+omziv@users.noreply.github.com>
Co-authored-by: chradek <51000525+chradek@users.noreply.github.com>
Co-authored-by: Adam Ling (MSFT) <adam_ling@outlook.com>
2021-09-30 18:00:27 -07:00
Maor Leger 9dc6167cf1
Update API Extractor for all packages (#17917)
## What

- Update API Extractor to the latest version (currently 7.18.11)
- Regenerate all API reviews by building all the packages

## Why

This is something we keep bumping into. First, we needed to upgrade API Extractor to allow us to re-export directly from
`@opentelemetry/api`. Then, it looks like we needed this to upgrade TypeScript to 4.4. 

We are way behind on this version, and it's time to upgrade.

## Callouts

How noisy is this?! Here's what's happening - somewhere around 7.9 I think API Extractor improved the way it detects name
collisions with predefined globals. Things like KeyType, Response, etc. 

If there's a clash, the generated API markdown file will rename <Item> to <Item_2> to make the name collision explicit.

Talking to folks on the team, and the poor souls that will be doing API Review approvals, we agreed that doing the upgrade
in one fell swoop is the way to go. 

Resolves #9410
2021-09-30 08:07:26 -07:00
Chidozie Ononiwu (His Righteousness) 23170c9256
Add PoliCheck tool to aggregate report pipeline (#17727)
* Add PoliCheck tool to aggregate report pipeline

* Exclude recordings from policheck run

* Use upper case for folder exclusion

* Fix up policheck issues

* Move CredScan into the Compliance stage

* Fixup policheck issues
2021-09-24 11:23:35 -07:00
chradek e2f6e8d801
remove delay devDependency (#17305)
Resolves #17089

`@azure/abort-controller` doesn't use `delay` in any tests, so easy removal.
`@azure/service-bus` used `delay` for perf tests, but only as a promisified setTimeout. Removed dependency and replaced with a simple delay function.
2021-09-20 16:38:16 +00:00
Jeremy Meng 74f543c776
[Engsys] Suppress credscan reported issues for test constants (#17505)
* Remove leftover recordings whose tests had been deleted

* Move test secrets into file so we can suppress the file, instead of suppressing using the unstable hashes

* Update suppression list
2021-09-14 12:49:16 -07:00
Jeremy Meng 13861173b6
Upgrade dev dependency ts-node to ^10.0.0 (#17323) 2021-09-10 15:38:24 -07:00
Harsha Nalluru 59838aa40d
[Perf Tests] Migrate the older perf test projects to new model - event based SDKs (#17383)
* move to the new structure

* minor edits

* sample.env and readmes

* more changes

* track 2 service-bus looks fine

* track 1 also seems fine

* more fixes

* formatting

* Update sdk/eventhub/perf-tests/event-hubs-track-1/README.md

Co-authored-by: Daniel Rodríguez <sadasant@users.noreply.github.com>

* Update sdk/eventhub/perf-tests/event-hubs-track-1/README.md

* Apply suggestions from code review

* lock file

* lock file from master

* lock file

* all minor feedback

* more formatting

* remove prebuild

* more care for readmes

Co-authored-by: Daniel Rodríguez <sadasant@users.noreply.github.com>
2021-09-10 10:34:29 -07:00
Azure SDK Bot 838d804c19
Post release automated changes for servicebus releases (#17538)
Post release automated changes for azure-arm-servicebus
2021-09-09 08:32:27 +00:00
colawwj df6fef5611
servicebus-track2 (#17536)
* servicebus-track2

* update
2021-09-09 15:20:14 +08:00
Deyaaeldeen Almahallawi 855ff18195
upgrade buffer to v6 (#17414) 2021-09-01 18:16:24 -04:00
Daniel Rodríguez b8f46a9175
Ensuring that the build script also cleans (#17123)
* [Identity] Ensuring that the build script also cleans

* ...everywhere!

* removing double cleans
2021-08-26 14:25:14 -04:00
Maor Leger f62d5e7a4d
[core] - Remove SpanOptions from the public API (#16984)
## What

- Removes spanOptions from OperationTracingOptions
- Prepares client package for compatibility with both existing and future core-tracing code by adding runtime casts / checks where spanOptions are concerned
- Adds `az.namespace` as an attribute on the current context, ensuring that it is available for tracing policies
- Adds spanOptions as a parameter to `createSpan` allowing customization of a newly created span
- Prepare tracingPolicies for backwards and forwards compatibility at runtime by using spanOptions as well as spanContext to determine the value of az.namespace to set on spans.

**Does NOT upgrade client libraries yet and their API will NOT change until we upgrade**

## Why

spanContext originally existed to be able to shepherd attributes around in order to add them to any child spans. Specifically, we need to add the az.namespace to the outgoing request span. Now that `tracingContext` is available as both a bag of values as well as a container for parenting info, we no longer need spanOptions.

Actually, spanOptions grew to add enums and other elements that caused us pain in the past. See #15285 as an example.

Finally, providing spanOptions as a publicly available option bag means that we are providing ways for consumers to customize our own spans. We don't need that, as we own the spans we create.

But what we still need to provide is a way for our own libraries to customize the spans they produce. By moving spanOptions off of OperationTracingOptions and into a separate parameter in createSpan we can support this.

## Callouts

I tested compatibility here in multiple ways:

1. I changed core-tracing's version to preview.13 so that all libraries will run tests against the new package
2. I then changed it _back_ to 14, so that all libraries will run tests against the old pacakge
3. I packed preview.13 with new bits and installed published packages for a few libraries and manually tested a few scenarios

Resolves #15285 
Resolves #16726
2021-08-24 14:51:37 -07:00
chradek 8c62014904
[service-bus] fix getMessageIterator docs (#16957) 2021-08-24 11:26:40 -07:00
Daniel Rodríguez ea06d10dd3
[Identity] Incrementing the package version (#16908)
* [Identity] Incrementing the package version

* setting samples to the last released version of Identity

* upgraded non-samples to 2.0.0-beta.6

* found a fix for the CI issue
2021-08-18 19:11:14 -04:00
chradek d80e0fec20
[service-bus] supdate long running stress test to use single sender (#16946) 2021-08-17 10:28:27 -07:00
Ben Broderick Phillips ddf47d5602
[stress testing] Update stress-test-addons chart version (#16934) 2021-08-16 14:06:33 -04:00
Ben Broderick Phillips 5d3b6fcb38
[stress testing] Improve dockerfile and ARM template for service bus (#16910)
* [stress testing] Fix service bus dockerfile directory add

* Build service bus stress test arm template with bicep
2021-08-13 13:35:28 -04:00
Ben Broderick Phillips fef5493b6e
Refactor service bus stress tests to use stress test package format (#16689)
* Re-organize eh stress files for stress test layout

* Add service bus stress test helm chart

* First pass generating stress job for each scenario

* Deep copy global template scope in stress test range loop

* Updates and deployment files for service bus stress

* Use base arm template

* fix helm template and docker build

* Final fixes to get service bus stress tests working

* [stress test] Update to use built-in scenario range addon

* [stress test] Minor fixes

* Update stress test program locations

* Run prettier over service bus stress test files
2021-08-13 12:30:28 -04:00
Deyaaeldeen Almahallawi a78a4c8b8f
Upgrade puppeteer dep to ^10.2.0 (#16864) 2021-08-12 01:13:46 +00:00
Ramya Rao a883638aeb
Add missing changelog entries for tracing and ES2017 updates (#16768)
This PR adds missing changelog entries for the times we
- updated tracing dependencies to use the GA version of OpenTelemetry
- updated to target ES2017
2021-08-04 22:11:55 +00:00
Maor Leger 5cd6362fbd
[core] - Align with latest OpenTelemetry implementations (#16347)
## What

- Remove `setTracer`
- Remove `NoOpTracer` and `NoOpSpan`
- Use Otel's APIs where possible (like when creating a no-op)
- Respect AZURE_TRACING_DISABLED environment variable
- Include test support for tracing utilizing OTel's trace API
- Avoid injecting invalid `tracerparent` header fields

## Why

- `setTracer` was added before OTel had their own implementation of a global tracer provider. For consistency with other libraries we should use the global tracer that was registered. It also leaves us out of the business of maintaining caches, global tracers, and other annoying things.
- These are no longer needed, since OTel has a recommended way to wrap a span in a NoOp. And, if no tracer provider was registered, a non-recording tracer  (NoOp) will be created. All managed by OTel
- Finally, AZURE_TRACING_DISABLED is one of the env vars our guidelines say we should support

Resolves #16088
Resolves #15730
Resolves #10205
2021-07-15 08:18:54 -07:00
Azure SDK Bot 8b79455fab
Increment package version after release of azure-service-bus (#16289) 2021-07-14 09:57:38 -07:00
Daniel Rodríguez 773c5b6ed7
[Identity] Increment versions after the recent release (#16342) 2021-07-09 17:32:44 -04:00
Maor Leger f5d75ae2d5
[core] - Remove TestTracer and TestSpan from public API (#16315)
## What

- Move `TestTracer`, `TestSpan`, and `SpanGraph` from @azure/core-tracing to @azure/test-utils

## Why

1. Having a folder called src/**test**/ does not play nicely with defaults generated by tools such as Yarn (specifically Yarn autoclean)
2. These are test support interfaces, and shouldn't be part of our public API anyway - now that we have @azure/test-utils it's the more appropriate location for them

Resolves #16265 
Resolves #16201
Related #13367
2021-07-09 11:11:15 -07:00
Richard Park 121d898e90
[service-bus] Mitigate session-overlap test (#16183)
We have an intermittent issue where we close a session and it releases, but there is a delay (Documented as part of this issue here: [link](https://github.com/Azure/azure-sdk-for-js/issues/14441). We've seen it in our normal live tests (not every time, but often enough to be noted).

I've done two things to make this "better":
- Mitigated the issue so we can still get a decent test signal by making the tests no longer use the same session ID. They didn't actually need to send or receive messages for the test itself (it's just validating that we're adding the right amount of credits) so I simplified the tests.
- Put in some wrapper code to make it simpler to reproduce the issue in the future. It will basically run these session based tests 1000x, which still doesn't _always_ reproduce the issue but can.

As a bonus, there was a `peekMessages()` test that expected that a message that has been sent will immediately be available, which isn't always true (there can still be a delay between "message accepted" and "message receivable"). I've fixed this test by doing a `receiveMessages()` first (which will wait until messages are available), abandoning the message and then doing a peek, which should work more reliably.
2021-07-08 13:22:58 -07:00
Richard Park ff0c7f8bb1
- Fix TS construct that isn't valid JS. (#16242)
- Adjust changelog date.
- Fix sample to not use an invalid JS construct
2021-07-07 00:44:01 +00:00
chradek aec5639eb0
[service-bus] add @types/ws to TypeScript samples package.json (#16238)
Fixes https://github.com/Azure/azure-sdk-for-js/issues/15666

It also turns out the samples depended on the `next` tag for service-bus, which is no longer published on NPM, so this update fixes that issue by depending on the `latest` tag.
2021-07-06 23:31:37 +00:00
bashiMoha dc6059810b
Dispaly links as list (#16117)
* displayed links as  a list rather than a single line

* appconfiguration\Readme:  displayed links as a list rather than a single line

* confidential-ledger-rest/README.md: display links as list

* container-registry/README.md: display links as list

* cosmos/README.md: display links as list

* iot-device-update/README.md: display links as list

* eventgrid/README.md: display links as list

* event-hubs/README.md: display links as list

* eventhubs-checkpointstore-blob/README.md: display links as list

* formrecognizer/README.md: display links as list

* identity/README.md: display links as list

* iot-modelsrepository/README.md: display links as list

* keyvault-admin/README.md: display links as list

* keyvault-certificates/README.md: display links as list

* keyvault-keys/README.md: display links as list

* keyvault-secrets/README.md: display links as list

* ai-metrics-advisor/README.md: display links as list

* mixedreality-authentication/README.md: display links as list

* monitor-query/README.md: display links as list

* purview-catalog-rest/README.md: display links as list

* purview-scanning-rest/README.md: display links as list

* quantum-jobs/README.md: display links as list

* search-documents/README.md: display links as list

* schema-registry/README.md: display links as list

* schema-registry-avro/README.md: display links as list

* service-bus/README.md: display links as list

* storage/storage-blob/README.md: display links as list

* storage-blob-changefeed/README.md: display links as list

* storage-file-datalake/README.md: display links as list

* storage-file-share/README.md: display links as list

* storage-queue/README.md: display links as list

* data-tables/README.md: display links as list

* ai-text-analytics/README.md: display links as list

* video-analyzer-edge/README.md: display links as list

* web-pubsub/README.md: display links as list

* web-pubsub-express/README.md: display links as list

* core-lro/README.md: display links as list

* changed from the word master to main

* changed the word master to main

* another update to the final reandme to change  the word master to main

* Update README.md

fixed a type in the link

* Update sdk/anomalydetector/ai-anomaly-detector/README.md

Co-authored-by: Deyaaeldeen Almahallawi <dealmaha@microsoft.com>

Co-authored-by: Deyaaeldeen Almahallawi <dealmaha@microsoft.com>
2021-07-06 12:30:32 -04:00
Richard Park d75f119fd6
[service-bus] Fix message loss issues with peekLock and receiveAndDelete (#15989)
Fixing an issue where we could lose messages or provoke an alarming message from rhea (`Received transfer when credit was 0`)
    
The message loss issue is related to how we trigger 'drain' using 'addCredit(1)'. Our 'receiver.drain; receiver.addCredit(1)' pattern actually does add a credit, which shows up in the flow frame that gets sent for our drain. This has led to occasionally receiving more messages than we intended.
    
The second part of this was that we were masking this error because we had code that specifically threw out messages if more arrived than were requested. If the message was being auto-renewed it's possible for the message to appear to be missing, and if we were in receiveAndDelete the message is effectively lost at that point. That code is now removed (we defer to just allowing the extrra message, should a bug arise that causes that) and we log an error indicating it did happen.
    
The rhea error message appeared to be triggered by our accidentally allowing multiple overlapping 'drain's to occur (finalAction did not check to see if we were _already_ draining and would allow it to happen multiple times). Removing the concurrent drains fixed this issue but I didn't fully investigate why.

Fixes #15606, #15115
2021-06-30 18:43:14 -07:00
Ramya Rao 5a7c129972
Update engines, @types/node to Node.js v12 (#15996) 2021-06-28 15:54:47 -07:00
Ramya Rao b729674427
Update Node.js & browser support in README (#16011) 2021-06-25 16:00:09 -07:00
Maor Leger 5903b7cd3d
[core] - Bump core-http to 2.0.0 and core-lro to 2.0.0 (#15925)
## What

- Update core-http to 2.0.0
- Update core-lro to 2.0.0
- Update packages to use latest version

## Why

This will support our last breaking change for core-tracing, and allow everyone to be on the same minimum version. This will also allow us to target ES2017 across the board.
2021-06-24 12:59:13 -07:00
Chidozie Ononiwu 5f71ecd285 Rename master to main 2021-06-24 09:14:06 -07:00
Richard Park 58b1993990
[service-bus] Fixing issue where links were not removed from our internal cache (#15929)
Today we cache any opened links in the connectionContext. These links should be removed when the link itself is closed but, due to a mismatch in the values, we weren't. 

I've fixed this by just making an abstract method in LinkEntity (the base for all the link types) and just having each link properly remove itself from the cache.

Fixes #15890
2021-06-23 19:00:57 -07:00
Will Temple c7f3a2a70b Replace master with main in homepage links. 2021-06-22 16:09:11 -07:00
Chidozie Ononiwu a64747cf6a Rename hardcoded master links to use main 2021-06-22 15:51:16 -07:00
Richard Park d4d2c75dbd
[service-bus] Closing some open areas where we could mask errors, and fixing flaky tests to be more reliable. (#15761)
Making changes to simplify a flaky test (and hopefully make it more reliable).

The main issue with the 'handle interrupted detach' method was that it relied on too many moving parts to work reliably. We could just eternally loop like we'd expect customers to do, but in the end we have a very simple test we're trying to perform - we want to receive, and while we're in the process of draining, cause a detach and have it early exit and reject/resolve immediately rather than waiting for the timeout.

I reworked the test to make that simpler by just removing the unneeded connection.idle() and just calling directly into the onDetached method. Because it happens prior to rhea even seeing that we're draining we should reliably win that race each time. 

There were a couple of other things changed for this PR as well:
- The max time per test was lowered accidentally. Bringing it back what's been used as the standard time in other libraries
- Fixed a spot in receiveMessages() where, if the link had been closed, we'd falsly return an empty array instead of throwing an exception indicating the link closed. This didn't appear to be related to the bug but it's incorrect and can hide bugs so I'd rather just throw the error than eat the condition and return an empty array. It's rare, but when it does happen the empty array response isn't right either - we're probably in the middle of a connection reset/change event.

Fixes #13461
2021-06-21 10:58:33 -07:00
Maor Leger d0232046bb
[Core] - Move core-tracing to @opentelemetry/api 0.20.0 (#15672)
## What

- Bump @opentelemetry/api to 0.20.0 in @azure/core-tracing
- Move all packages that are on core-http to the next core-tracing version 
- Remove version collision check from the tracer cache

## Why

This is part of our effort to move everyone to OTel 0.20.0 - but we have to stage it due to a transitive dependency and a 
breaking change in OTel. This PR updates core-tracing to use the latest OTel, fixes any breaking changes, and moves 
packages that we can move to the latest version of core-tracing.

Once core-rest-pipeline 1.1.0 is GA'd we'll be able to move the rest of the packages over to the latest core-tracing as well.

Removing the version collision came out of an offline discussion after these changes were reviewed - since it's a common 
source of pain and hasn't added much benefit (tracer conflicts incompatibility was never a problem) we decided to remove 
that logic and always grab a unique symbol per OT compatibility. 

## Callouts

The packages that are already on core-v2 will _not_ be upgraded at this time - we'll coordinate that with the GA of core-rest-pipeline 1.1.0
2021-06-18 15:57:58 -07:00
Jeremy Meng 11e2a4bdd4
Remove IE related doc and tests (#15760)
As we are ending the support for IE 11, this PR remove doc and test logic that
handle IE.

- Remove commented polyfill from karma configs
- Remove IE compatibility section from Stroage README files
- Remove IE specific logic from storage tests.
- Remove Storage TODO comments for IE.

* format

* run format on core-client-rest
2021-06-16 14:20:49 -07:00
Richard Park 2b246bdaca
[service-bus] Flaky test fix - un-awaited abandonMessage() calls cause unrelated tests to fail (#15716)
We had some abandonMessage() calls in atomE2E.ts that were not being await'd on, which meant when they did ultimately fail, it would happen in an unrelated test.

I'm a bit unsure why but it appears that mocha was attributing these failures to these tests, even though they weren't started or a part of them.

As an example: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=943479&view=logs&j=07f0c2bc-806a-58d0-ca0d-069f605ef81d&t=fd27c4cf-da6b-5a51-aa3d-cd45c93f6ef8

(there are other failures in that same build that I'm not entirely are are related, but this part is definitely incorrect and can be fixed).
2021-06-12 01:05:02 +00:00
KarishmaGhiya 18b0c92bbc
Updating identity v2 beta versions for identity tests and reverting to GA version v1 for samples (#15654)
Co-authored-by: Jeremy Meng <jeremy.ymeng@gmail.com>
2021-06-11 14:58:57 -07:00
Deyaaeldeen Almahallawi d3f0285339
[tslib] Upgrade from 2.0 to 2.2 (#15702) 2021-06-11 16:09:45 -04:00
Azure SDK Bot 5c4354f341
Increment package version after release of azure-service-bus (#15673) 2021-06-10 13:27:19 -07:00
Richard Park c300481e7c
[service-bus] Fix autoCompleteMessages help to indicate that it'll both completeMessage() and abandonMessage() (#15658)
Updating doc comment for autoComplete, indicating that it will abandon() if an error is thrown.

The prior text made it sound like it would call complete() no matter what happened, which was confusing.

Fixes #15519
2021-06-10 02:01:00 +00:00
KarishmaGhiya b18ddca6c4
update version of identity for perf tests and samples of service-bus (#15632) 2021-06-09 23:44:17 +00:00
Richard Park e4e9497fa1
[service-bus] Updating changelog with proper date and features for 7.2.0 GA release (#15548)
Updating changelog for 7.2.0 GA release with AMQP body type encoding.
2021-06-09 18:19:26 +00:00
chradek 3866111776
[service-bus] pass abortSignal to link initialization and awaitableSender (#15349)
* [service-bus] pass abortSignal to link initialization and awaitableSender

* [service-bus] add changelog entry

* [core-amqp] remove AsyncLock!

* [service-bus] fix test after the great merge

* npm run format

* fix abort on send after great merge
2021-06-08 20:19:55 -07:00
chradek dec897afb2
[core-amqp][event-hubs][service-bus] Fixes _process of undefined TypeError (#15597)
This PR fixes #13500.

`rhea` 2.0.1 contains the fix to this specific error. We currently use `rhea` 1.x, so there's additional work in this PR to workaround the single breaking change in `rhea`, and the breaking changes in `rhea-promise`.

### rhea breaking change

`rhea` contains 1 breaking change between versions 1.x and 2.x: timestamp types are now deserialized as Date objects instead of numbers. Unfortunately since this changes the way users' data might be deserialized in their service bus messages or event hubs events, we have to convert Date objects back to numbers in our client libraries until we do a major version bump. (Shorter term we can look at using rhea's default behavior behind a flag.)

### rhea-promise breaking changes

Some of the `rhea-promise` APIs that accepted multiple optional positional arguments have been updated to take a single options bag parameter at the end of their method parameter list.

AwaitableSender was also updated so that a timeout is no provided at instantiation. Instead, it must be provided per each `send()` call.

### core-amqp v3
Since core-amqp is being updated to depend on rhea 2.x, core-amqp dependencies will also pull in rhea 2.x transitively.
To ensure that existing versions of event hubs and service bus don't break by deserializing timestamps as Date objects, core-amqp is updated to a new major version: v3. 

Once #15349 is merged, we can also remove `AsyncLock` completely, so I'd like to merge that PR in before releasing the changes in this PR.
2021-06-08 21:23:39 +00:00
Richard Park 2e56a4f08d
[service-bus] Updating samples to fix a few issues: (#15430)
Updating samples to fix a few issues:
- Show the right way to restart your receiver when using sessions (which
don't do automatic retries like non-sessions).
- Some of the samples printed almost too little console output to indicate what
  they were doing or didn't demonstrate the right techniques (asking for multiple
  messages at a time, etc..). Those have been updated as well.

Fixes #14531
2021-05-27 14:38:36 -07:00
Richard Park 1888d8c3cd
[service-bus] getMaxMessages needs to retry if link doesn't initialize (#15409)
getMaxMessages had an edge case where the link being closed just after open would cause us to access a link that was undefined and throw a non-retryable exception.

This PR fixes that by checking that the link is defined, and throwing a retryable exception if it is not.

Fixes #15398
2021-05-25 17:05:45 -07:00
Richard Park 0efa83db98
[service-bus] Remove dead code in MessageSender.sendMessages (#15406)
We always send messages via the 'batch' version of the method now, so the original array-based version with `sendMessages` is no longer used.
2021-05-25 19:48:26 +00:00
Azure SDK Bot ed6f5ebb03
Increment package version after release of azure-service-bus (#15322) 2021-05-20 11:17:14 -07:00
Richard Park 4cf3566d2a
[service-bus] Final work to expose AMQP body type encoding publicly (#15295)
Finishing work to enable AMQP body type encoding

- We completely missed the schedule messages code path. Added, with tests.
- Consolidated the two files of AMQP messaging tests into the `public` branch so we also get min/max testing. Removed all references to non-published interfaces.
2021-05-17 18:54:11 +00:00
Jose Manuel Heredia Hidalgo 5b37cb8953
Update DeviceUpdate and ServiceBus samples to v2 (#15068)
Updating Device Update and Service Bus samples to the v2 workflow
2021-05-14 00:52:52 +00:00
Richard Park 63624ccc3b
[service-bus] Re-enabling the AMQP body type encoding feature. (#15271)
Re-enabling the AMQP body type encoding feature. We disabled this temporarily when we released 7.1.0 and are now re-enabling this in time for our new preview: 7.2.0-beta.1
2021-05-13 21:57:30 +00:00