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

1124 Коммитов

Автор SHA1 Сообщение Дата
Jeremy Meng 0c82aca851
[ServiceBus] fix issue of accepting session with empty string name (#31736)
We have a check for when asking for any session, i.e., not providing a
session id), but not receiving a link having a session id. However, the
check is `if (!this._providedSessionId && !receivedSessionId)` which
also evaluates to `true` for session id of empty string, which is valid
session id.

This PR changes it to check for `undefined` so that session id of empty
string doesn't lead to error being thrown.
2024-11-20 15:22:18 -08:00
Jeremy Meng a28e8f0795 [EngSys] move to vendored version of cross-env via dev-tool
***NO_CI***

- apply the transformation

- update samples' README
2024-11-02 00:48:06 +00:00
Jeremy Meng 980f3cbb89 [EngSys] move `uglify-js` to dev-tool vendored
- add dep to `uglify-js` in dev-tool

- rush update

- replace "uglifyjs" with "dev-tool run vendored yglifyjs"

- remove dependency to "uglifyjs" in sdk packages

***NO_CI***
2024-10-30 18:01:20 +00:00
Jeremy Meng 6a2c7300eb [eslint-plugin] add rule "@typescript-eslint/consistent-type-imports": "warn"
- apply lint:fix results

- revert fixes that are not related to consistent-type-imports and cases error

- regenerate .api.md files

- format

- update core-comparison diff
2024-10-30 15:48:52 +00:00
Jeremy Meng 1cae9db8e1 [EngSys] remove "audit" NPM script and it's related file
as we no longer use it and rely on GitHub security features.

***NO_CI***
2024-10-25 19:28:06 +00:00
Jeremy Meng 59bb0809ba [EngSys] use vendored version of `mkdirp` and `rimraf` from dev-tool
also remove dependency on `@microsoft/api-extractor` as we already move to
`dev-tool run extract-api` which calls api-extractor Api instead.

***NO_CI***
2024-10-23 17:53:07 +00:00
Jeremy Meng d0b70a8253
[ServiceBus] expose omitMessagesBody option under ./experimental subpath (#31361)
playing with the idea of exposing features under the `./experimental`
subpath and add a dev-tool command to report error if we consume
experimental Apis in a GA package.

[ServiceBus] Add the experimental diagnostic feature omitMessageBody 

via an augmented `PeekMessagesOptions` interface under `./experimental`
subpath export.

After migrating to ESM, we no longer use rolled-up dts files thus lose the ability
to trim `@beta` Apis from public type definition files. This PR explores an approach to
expose Apis from the `./experimental` export.
2024-10-16 15:37:05 -07:00
Wes Haggard 1c50b6ac49
Switch to TME test subscription (#31329) 2024-10-14 18:19:12 -07:00
Jeremy Meng be9a5757b0
[ServiceBus] re-enable min/max testing (#31396)
now that we have better merged vitest configs
2024-10-14 13:46:11 -07:00
Jeremy Meng 0e2c0bd934
[ServiceBus] migrate to ESM/tshy/vitest (#31304)
- apply the result of `dev-tool admin migrate-package --package-name
@azure/service-bus`

without removing chai usages in tests because it is causing crash when
running
the command

- work around compilation error from "long" with `"skipLibCheck": true`

- fix assert/chai/etc.

- replace sinon usage with vi
2024-10-11 08:35:13 -07:00
Jeremy Meng 652a7ffa89 [eslint-plugin] fix ts-naming-options rule issue
***NO_CI***

Currently the rule only handles the case of

```ts
  clientMethod(options: MethodOptions) {}
```

but not when the options bag parameter has a default value

```ts
  clientMethod(options: MethodOptions = {}) {}
```

This change adds code to handle the latter.

- Add two unit tests

- Update the affected packages to suppress this rule as a warning

- react to the fix
2024-10-02 16:40:01 +00:00
Jeremy Meng 537dc7dcaa
[ServiceBus] integrate changelog from 7.9.5 (#31243) 2024-09-26 18:03:52 -07:00
Matthew Podwysocki 61c8b9aae4 [EngSys] Add update-snippets to all package.json files ***NO_CI*** 2024-09-26 17:59:37 +00:00
Jeremy Meng a7b3656a05 [EngSys] upgrade dev dependency `typescript` version to `~5.6.2`
***NO_CI***

- replace version to "~5.6.2"
- rush update
- add `"skipLibCheck": true` for several packages that are affected by https://github.com/vitest-dev/vitest/issues/4688

- [formrecognizer] help TypeScript to understand with more explicit type

- [schema-registry-{avro,json}] skip lib check due to lru-cache issue with the Iterator TReturn change

https://github.com/isaacs/node-lru-cache/issues/348
2024-09-19 18:07:31 -07:00
Jeremy Meng bc7574ebf7
[Test] downgrade test-credential to v1 for Service Bus tests (#30913)
as it hasn't been migrated to vitest yet.
2024-09-10 13:41:49 -07:00
ZiWei Chen 928149383a
[mgmt] add Sanitized rule and update changelog template to fix ci fai… (#30226) 2024-09-06 17:10:40 +08:00
Jeremy Meng d5f6d677ec [EngSys] standardize OSS copyright header
- [eslint-plugin] github-source-headers rule should use "MIT License".

  This change updates our linter rule and the whole repository to have consistent
  license header.

***NO_CI***

- remove "All rights reserved." from header

- "MIT license" => "MIT License"
2024-08-27 13:01:38 -07:00
Jeremy Meng f04044e34e [eslint] remove ESLINT_USE_FLAT_CONFIG=true env variable
now that we have moved to eslint v9.

***NO_CI***
2024-08-26 12:52:48 -07:00
Jeremy Meng 5adb09d715 [engsys] upgrade dev dependency eslint to v9
***NO_CI***

- bump eslint version to ^9.9.0
- [eslint-plugin] remove eslint-plugin-import for now. Will re-visit until it supports eslint v9
2024-08-23 16:37:40 -07:00
Jeremy Meng 2ce3c5feb4 [eslint-plugin] upgrade typescript-eslint to v8
***NO_CI***

- bump typescript-eslint dependencies version to ~8.2.0

- [eslint-plugin] suppress new linting errors appearing with v8

- [eslint-plugin] react to removed typescript-eslint property

  related PR https://github.com/typescript-eslint/typescript-eslint/pull/9025

- [eslint-plugin] turn off @typescript-eslint/no-unused-expressions

  as no-unused-expressions is already reported by eslint

- [dev-tool] fix new linting errors

- Remove @typescript-eslint/ban-types that no longer exists

  and replace with more specific rules wherever applicable.

- [cosmosdb] combine the test eslint config with the main one

- delete catch expression when caught error is not used

- fix or suppress linting errors in code files
2024-08-23 10:19:23 -07:00
Deyaaeldeen Almahallawi ba15a9cab6
[Service Bus] Migrate to bicep (#30847)
And bump API versions.

Live tests run:
https://dev.azure.com/azure-sdk/internal/_build/results?buildId=4069728&view=results
2024-08-21 14:16:06 -07:00
Jeremy Meng af6ccc6765
[eslint] move eventhub and servicebus to flat config (#30807)
- replace .eslintrc.json with eslint.config.mjs
- fix linting errors
  - URL is in global scope on all of our supported platforms
- we use "buffer" npm package for browsers support so suppressing errors
2024-08-20 08:45:49 -07:00
Jeremy Meng 405c244bb1 [linting] move perf tests to use eslint flat config
***NO_CI***

- add one flat config file for perf tests

- update NPM scripts of these packages to use that flat config for perf tests

  As eslint v8 still not switched to flat config by default, this change
  temporarily uses `cross-env` to set `ESLINT_USE_FLAT_CONFIG=true`

  Once we moved to eslint v9 the env var can be removed.
2024-08-15 10:56:56 -07:00
Jeremy Meng 78671335a4
[EngSys] upgrade dev dependency `puppeteer` to ^23.0.2 (#30727)
- replace v22 version with v23 version
- run `rush update`
2024-08-13 12:05:49 -07:00
Harsha Nalluru f72747e9eb
[Service Bus] Deleting perf libs folder (#30615)
Focuses on cleaning up the perf libs folder by removing outdated and
redundant performance tests for various packages under the service-bus
directory. The changes are as follows:

- `azure-sb` 
- The package has been deprecated and is no longer in active use.
Therefore, maintaining performance tests for this package is
unnecessary.
- `@azure/service-bus@7.x` 
- this version has the perf tests under
`sdk/servicebus/service-bus/perf-tests/` folder
- `@azure/service-bus@1.x` 
- this version has seen a significant decline in usage has less than
2.5% of the downloads (in the past 7 days) compared to
`@azure/service-bus@7.x`, making it insignificant to maintain
- `rhea-promise` tests 
- `rhea-promise` package are also being removed. However, if there is a
future need to compare benchmarks, we can reintroduce rhea-promise tests
under the `sdk/servicebus/service-bus/perf-tests/` folder.

This helps to streamline our perf tests, reduce maintenance overhead,
and ensure that our focus remains on the most relevant and actively used
packages.
2024-08-01 17:55:26 -07:00
Jeremy Meng c5ff0f69fa
[Docs][ServiceBus] remove broken links to usingAadAuth sample (#30590)
as the sample has been removed.
2024-07-31 11:57:26 -07:00
Jeremy Meng e3b922af76
[Test][ServiceBus] work around Managed Identity credential issue (#30583)
In live test pipeline, our DefaultAzureCredential would succeed in getting a token from MSI
but that token doesn't work with our test resources. This PR works around the issue by passing
a fake Msi client id to DefaultAzureCredential constructor, thus cause token retrieval to fail,
and DefaultAzureCredential can continue to try the next credential type in the chain.
2024-07-31 09:20:39 -07:00
Jeremy Meng c5d026f949
[Test][ServiceBus] move to federated auth (#30212)
- updating test dev dependencies
 - add fully qualified namespace env var
 - update atomE2ETests to use token credential
 - Update test utils to use createTestCredential
 - use SERVICEBUS_FQDN to create clients for test
 - use namespace for premium testing too
 - add `UseFederatedAuth: true` in tests.yml
 - remove usingAadAuth sample
2024-07-30 09:37:14 -07:00
Jeremy Meng 3a68e456b2 [Samples] update "src/**.ts" to "src/**/*.ts" in tsconfig.json
Previously dev-tool has been fixed to generate correct include path in samples
tsconfig.json but samples were not updated.

This PR fixes the samples tsconfig.json in one run; otherwise with the recent
branch protection policy changes, when individual packages re-publish samples,
js-core team would have to approve the tsconfig.json changes.

***NO_CI***
2024-07-24 13:53:00 +00:00
Jeremy Meng b93b62368b [EngSys] remove tsconfig.package.json
which only extends from tsconfig.json.  There might be more customization for
packages in the early days but not any more.

This PR removes it and updates packages to extends tsconfig.json directly

***NO_CI***
2024-07-16 13:27:25 +00:00
Jeremy Meng e6737fc679
[EngSys] remove `downlevelIteration` typescript option (#30398)
It helps old JS runtimes that only support ES 5 but we moved to ES 6
long time ago
and now moved to ES2017. Most of our packages don't have this option.
This PR
removes its usage.
2024-07-12 12:34:56 -07:00
Jeremy Meng 1a09f43108 [EngSys] upgrade dev dependency `typescript` version to `~5.5.3`
***NO_CI***

- also include *.api.md updates due to the following TypeScript 5.5 change

https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-5.html#simplified-reference-directive-declaration-emit
2024-07-03 22:24:35 +00:00
Jeremy Meng 74dfa883b9 [EngSys] upgrade dep dependency `nyc` to ^17.0.0
***NO_CI***
2024-06-28 17:57:40 +00:00
Jeremy Meng 250faf04d1
[Test][ServiceBus] update expected error message (#30025)
This particular error message was updated in PR #29853 but the test wasn't and since it's a live test, the CI didn't catch it. This PR fixes the test failure by updating the expected error message.
2024-06-20 11:35:16 -07:00
Jeremy Meng e798d4749c
[dev-tool] fix samples typescript source to include sub directory (#30024)
Sample source structure used to be flat but later nested directories are
supported as well. This PR fix the glob pattern to also include sub
directories.

- also re-publish samples for @azure/service-bus

I didn't update all the other samples as there are no complaints. They
can get new update in their next publish.
2024-06-13 21:47:21 -07:00
Maor Leger 2e040fae8a Bump @azure/identity to 4.2.1 in samples ***NO_CI*** 2024-06-11 14:01:31 -07:00
Jeremy Meng f21039b853
[ServiceBus] close link before throwing error in createRheaLink() (#29954)
This PR fixes a memory leak in `MessageSession.createRheaLink` where in
error cases we didn't
close the created `rhea-promise` receiver. Eventually this would lead to
client exceeding the quota on maximum allowed links on a connection.

The fix is to close the created receiver before we throw errors.
2024-06-10 16:14:36 -07:00
Jeremy Meng 12a14b4a5e
[ServiceBus] Remove verification of abort error messages in tests (#29853)
After upgrading to `@azure/abort-controller` v2, some tests that verify
the
abort error messages have been failing. It turns out that in our async
operations because multiple callbacks are attached to the same abort
signal (for
example, retry logic, delay calls for timeout, authentication, auto
lock-renewing, etc.) and multiple abort errors are thrown reacting to
their
signal being aborted. After upgrading to `@azure/abort-controller` v2,
the order
of `AbortError`s being thrown have changed thus the error we catch in
the test
is now different from the one before upgrading. It is possible that our
previous
`AbortContoller` implementation of parent-children aborter pattern
implies
certain ordering which is different from when manually attaching
callbacks.
However, what's important to the consumer of our APIs in this scenario
is that
the operation is aborted, AbortErrors are thrown, and one of them is
caught,
even a different one than before.

This PR removes verification of the error messages.

I also realize that it is not useful to re-throw the error from delay
for
timeout operation, when the delay operation is aborted either because a
signal
is aborted, or because a operation it is waiting for succeeds. So that
error is
swallowed.

-------

### Packages impacted by this PR
`@azure/service-bus`
2024-06-03 15:55:22 -07:00
Jeremy Meng 85fcbb3733
[ServiceBus] upgrade dependency @azure/abort-controller to ^2.1.2 (#29807)
- fix compilation errors
- fix v7-beta sample tagetting version
2024-05-24 22:57:03 +00:00
Jeremy Meng 5bdb96ba1c
[test][CI] move test building into test:browser scripts (#29633)
for non-core packages in js - core pipelines.

This PR is a follow-up of PR
https://github.com/Azure/azure-sdk-for-js/pull/29411 for non-core
packages.
2024-05-10 14:51:03 -05:00
Jeremy Meng 7f1cb9af14
[EngSys] enable build cache for more packages in core - ci pipelines (#29636)
Build cache was enabled for most of our commonly built packages in PR
https://github.com/Azure/azure-sdk-for-js/pull/27409.

This PR enables build cache for several more packages that get built in
core -
ci pipelines to further reduce time on packages when they haven't
changed.
2024-05-09 09:16:39 -07:00
Matthew Podwysocki cd3cf2e03e [EngSys] Update version of @azure-tools/test-utils ***NO_CI*** 2024-05-08 11:54:46 -07:00
Harsha Nalluru 0b36662941
[Service Bus] Fix build failure `typeof chai.assert` (#29582)
### Packages impacted by this PR
`@azure/service-bus`

### Issues associated with this PR

https://dev.azure.com/azure-sdk/public/_build/results?buildId=3759006&view=logs&j=3dc8fd7e-4368-5a92-293e-d53cefc8c4b3&t=acc99708-be46-50ff-f197-4ecb2c3cab18&l=733

### Describe the problem that is addressed by this PR
Strange build failure seen in
https://dev.azure.com/azure-sdk/public/_build/results?buildId=3759006&view=logs&j=3dc8fd7e-4368-5a92-293e-d53cefc8c4b3&t=acc99708-be46-50ff-f197-4ecb2c3cab18&l=733

![image](https://github.com/Azure/azure-sdk-for-js/assets/10452642/3db414ff-02ed-4b7e-b132-b48499e858c9)

Unblocks #29577
2024-05-06 17:46:33 +00:00
Jeremy Meng 9ea59031c5
[ServiceBus] Revert to check deleted count against MaxDeleteMessageCount (#29510)
as this is the contract between SDK and service.


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

### Issues associated with this PR
#29503
2024-04-30 13:12:48 -07:00
Jeremy Meng 554e1c44f9
[ServiceBus] add suppport to batch-delete messages (#28627)
### Packages impacted by this PR
`@azure/service-bus`

### Issues associated with this PR


### Describe the problem that is addressed by this PR
Add support to batch-delete messages

---------

Co-authored-by: Jeff Fisher <jeffish@microsoft.com>
Co-authored-by: Deyaaeldeen Almahallawi <dealmaha@microsoft.com>
2024-04-29 21:47:17 +00:00
Jeremy Meng bd4ccb16c2
[EngSys] shorten `-no-test-proxy=true` test option (#29466)
The "=true" part is no longer needed after PR #28978
2024-04-26 19:33:31 +00:00
Matthew Podwysocki 769c1b126e [EngSys] Update name of @azure-tools/test-utils ***NO_CI*** 2024-04-25 13:14:33 -07:00
Jeremy Meng e9561c1a52 [EngSys] back to use `nyc` for code coverage
now that we removed `esm` dependency, `nyc` should be working again, and `nyc`
appears to have better results than `c8` does.

***NO_CI***
2024-04-19 12:19:32 -07:00
Maor Leger 224f7c1c14 [EngSys] Migrate to dev-tool extract-api ***NO_CI*** 2024-04-19 18:13:41 +00:00
Jeremy Meng f955996337
[Test][ServiceBus] react to the retryable error change in core-amqp (#29278)
PR #28751 updates the message of thrown error from retry to include
messages of all the retried errors. This PR fixes affected Service Bus
tests.
2024-04-17 21:10:44 -07:00