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

313 Коммитов

Автор SHA1 Сообщение Дата
Matthew Podwysocki faa0046a76
[template] Upgrade @azure/template-dpg to ESM/vitest (#31837)
### Packages impacted by this PR

- @azure/template-dpg

### Issues associated with this PR

- https://github.com/Azure/azure-sdk-for-js/issues/31338

### Describe the problem that is addressed by this PR

Upgrades @azure/template-dpg to ESM/vitest

### 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?


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


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


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

### Checklists
- [ ] 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)

---------

Co-authored-by: Jeremy Meng <jeremy.ymeng@gmail.com>
2024-11-19 14:23:27 -08:00
Azure SDK Bot 5edf27a030
Sync eng/common directory with azure-sdk-tools for PR 9381 (#31816)
* change our verifyChangelogs over to utilizing the artifact details. if we don't have an artifact details at all, don't verify changelog. if we do, but skipverifychangelog is present, don't verify changelog. if we have artifact details, but no disable, verify the changelog

---------

Co-authored-by: Scott Beddall <scbedd@microsoft.com>
2024-11-18 15:13:02 -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 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
Jiao Di (MSFT) 1763129fe3
Upgrade typescipt version (#31527)
Upgrade typescript version to `5.6.2`.
2024-10-25 16:44:31 +08: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
Matthew Podwysocki 73e9ecd568
[template] Add retry/timeout to macOS tests (#31314)
### Packages impacted by this PR

- @azure/template

### Issues associated with this PR

- #31296

### Describe the problem that is addressed by this PR

Adds a better timeout and retry logic for the issues with the best being
flaky.

### 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?


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


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


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

### Checklists
- [ ] 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)
2024-10-04 16:06:47 -04:00
Matthew Podwysocki 4d4b874244
[template] Add supportsTracing back (#31300)
### Packages impacted by this PR

- @azure/template

### Issues associated with this PR


### Describe the problem that is addressed by this PR

Adds `supportsTracing` back to the template project.

### 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?


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


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


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

### Checklists
- [ ] 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)

---------

Co-authored-by: Timo van Veenendaal <timov@microsoft.com>
2024-10-04 10:42:57 -04:00
Timo van Veenendaal 9a717bf26c
[template] Add role assignment to test-resources.bicep (#31306)
### Packages impacted by this PR

- `@azure/template`

### Describe the problem that is addressed by this PR

Grants the "App Configuration Data Owner" when deploying the template
live test resources. This fixes some issues recording tests for the
template package (and possibly the live tests too).

Copied from the App Config test-resources.bicep
[here](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appconfiguration/test-resources.bicep)
2024-10-03 14:07:10 -07:00
Maor Leger c710e9b67f
[template] Skip flaky test in Mac OS (#31297)
One of the template tests has been flaky on Mac OS. Given that template
is run as part of core and likely most PRs we decided to pend the test
for now and investigate it as part of #31296
2024-10-02 13:54:36 -07:00
Maor Leger e99e5dd409
[dev-tool] Use tsx (#31284)
### Packages impacted by this PR

@azure/dev-tool

### Issues associated with this PR

Resolves #29672

### Describe the problem that is addressed by this PR

With the move to ESM and tshy we've been running into issues using the
existing TS_NODE
based loader in dev-tool. Specifically we're seeing errors such as:

```
[run-samples] Error: Must use import to load ES Module: D:\a_work\1\s\sdk\template\template\samples-dev\getConfigurationSetting.ts
require() of ES modules is not supported.
require() of D:\a_work\1\s\sdk\template\template\samples-dev\getConfigurationSetting.ts from D:\a_work\1\s\common\tools\dev-tool\src\commands\samples\run.ts is an ES module file as it is a .ts file whose nearest parent package.json contains "type": "module" which defines all .ts files in that package scope as ES modules.
Instead change the requiring code to use import(), or remove "type": "module" from D:\a_work\1\s\sdk\template\template\package.json.
```

ts-node is being phased out for tsx, a modern alternative that handles
hybrid scenarios like us in much simpler manner.

This PR switches our loader from ts-node to tsx. Now we can run samples
again for both cjs and esm!
2024-10-02 12:23:56 -07:00
Jeremy Meng 7afc88a173
[template] skip samples execution temporarily (#31240)
until issue #29672 is fixed.
2024-09-26 15:10:56 -07:00
Matthew Podwysocki 61c8b9aae4 [EngSys] Add update-snippets to all package.json files ***NO_CI*** 2024-09-26 17:59:37 +00:00
Maor Leger 64c72d5dda [engsys] Move all packages to build-package script ***NO_CI*** 2024-09-25 18:52:35 +00:00
Jeremy Meng 13f5beb45a
[eslint-plugin] turning off some rules for test/snippets.spec.ts (#31205)
as its code is meant to be included in docs and not required to be
perfect.
2024-09-24 14:06:22 -07:00
Matthew Podwysocki 8597959155
[dev-tool] Add snippets extraction (#31143)
### Packages impacted by this PR

- @azure/dev-tool

### Issues associated with this PR

### Describe the problem that is addressed by this PR

This PR implements a new dev-tool command: `dev-tool run
update-snippets`.

This command looks for code fences in markdown files and JSDoc comments,
and updates them with the contents of test methods in a file named
`snippets.spec.ts`.

For example, the following fence indicates that the contents of a test
named "new_configurationclient" should be used:

````
```js snippet:new_configurationclient
```
````

After running `dev-tool run update-snippets`, the contents of the
snippet will be populated:

````
```js snippet:new_configurationclient
import { ConfigurationClient } from "@azure/template";
import { DefaultAzureCredential } from "@azure/identity";

const client = new ConfigurationClient(
  "<app configuration endpoint>",
  new DefaultAzureCredential()
);
```
````

To accomplish this, the command uses the TypeScript compiler API to
extract and transpile snippets from `snippets.spec.ts`. Snippets are the
contents of calls to the `it` function. If syntax with the shape
`it(<literal string>, <function with block>)` appears in
`snippets.spec.ts`, it will be considered a snippet that is valid for
injection.

("Function with block" means either a `function () { ... }` expression
or an arrow function with a block on the arrow side (`() => { ... }`).
An arrow function that has an expression on the right hand side (`() =>
(...)`) will not be recognized.)

For example:

```ts
  it("new_configurationclient", function () {
    // @ts-ignore
    const client = new ConfigurationClient(
      process.env.ENDPOINT ?? "<app configuration endpoint>",
      new DefaultAzureCredential()
    );
  });
```

The transpiler automatically "cleans" and validates the snippet using
similar techniques as the sample transpiler. As a result, it enforces
the same syntactic rules that the sample transpiler does. In addition to
those, it removes references to `process.env` (if an alternative is
specified), removes compiler pragmas like `// @ts-ignore`, and
automatically inserts imports for symbols that the snippet uses. So in
the above snippet, imports for `ConfigurationClient` and
`DefaultAzureCredential` are required, automatically detected, and
injected into the resulting snippet.

Snippets without `snippet:${name}` tags are _errors_ when using this
command, so a package must be fully migrated to use it.

### 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?


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


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

- #24536

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

### Checklists
- [ ] 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)
2024-09-20 19:05:10 -04: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 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 4ab6590ffe Apply automated migration to eslint flat config 2024-08-22 11:43:19 -07:00
Deyaaeldeen Almahallawi 1260758729
[Template] Migrate to Bicep (#30865)
And update API versions.

Live tests run:
https://dev.azure.com/azure-sdk/internal/_build/results?buildId=4072924&view=results

Failure is unrelated.
2024-08-22 10:31:41 -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
Deyaaeldeen Almahallawi 04e383e6f9
Upgrade tshy to v2 (#30747)
And in some cases downgrade from v3 to v2 (in event hubs and in
core-sse).
2024-08-13 16:01:59 -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
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
Minh-Anh Phan 681de6db5b
[Eng] Set Default for Federated Auth to True (#30163)
### Describe the problem that is addressed by this PR
Remove local federated auth in tests.yml and enable Federated Auth by
default in eng folder
2024-07-22 17:24:20 -07: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 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
Matthew Podwysocki c8aa2f8fdf [EngSys] Update version of tshy ***NO_CI*** 2024-07-03 18:40:06 +00:00
Jeremy Meng 1c9a68133b [EngSys] ignore and remove .tshy directories
We currently don't have a use for them and they are safe to ignore based on the
answer in https://github.com/isaacs/tshy/issues/78#issuecomment-2203955286

***NO_CI***
2024-07-03 16:46:35 +00:00
Jeremy Meng e7312b346e [EngSys] commit file changes caused by tshy upgrades
this is a result of `rush build` on latest main.

***NO_CI***
2024-07-02 16:52:37 +00:00
Jeremy Meng 74dfa883b9 [EngSys] upgrade dep dependency `nyc` to ^17.0.0
***NO_CI***
2024-06-28 17:57:40 +00:00
Maor Leger d1149283dd
[engSys] Run rush build (#30129)
Run `rush build` on the repo to ensure the newly added `source` fields
are generated.

This avoids unnecessary noise on PRs that may build tshy packages as
part of their dependency graph (such as #29374)
2024-06-20 12:15:33 -07:00
Azure SDK Bot b1a0bcbc0c
Sync eng/common directory with azure-sdk-tools for PR 8463 (#30091)
Sync eng/common directory with azure-sdk-tools for PR
https://github.com/Azure/azure-sdk-tools/pull/8463 See [eng/common
workflow](https://github.com/Azure/azure-sdk-tools/blob/main/eng/common/README.md#workflow)

---------

Co-authored-by: Wes Haggard <Wes.Haggard@microsoft.com>
Co-authored-by: Wes Haggard <weshaggard@users.noreply.github.com>
2024-06-18 18:37:18 -04:00
Maor Leger 2e040fae8a Bump @azure/identity to 4.2.1 in samples ***NO_CI*** 2024-06-11 14:01:31 -07:00
Ben Broderick Phillips f83c9afd19
Add federated auth mode for live testing (#29848) 2024-06-03 14:25:37 -04:00
Jeremy Meng 5c6b5e405d
[engsys] upgrade dev dependency rimraf to ^5.0.0 (#29847)
most of packages in this repo already have version v5. This PR upgrades the rest to not have the now deprecated v3.
2024-05-30 19:27:28 +00:00
Harsha Nalluru 2b71281fb7
`rush update --full` and testing #29471 (#29655)
## What's happening?
- [x] Get Scott's test-proxy version from #29471 
- [x] Update `recorder 3.5.0` with
    - [x] Central Sanitizers
    - [x] /removeSanitizers API
    - [x] remove fallback sanitizers
    - [x] Publish `recorder 3.5.0`
- [x] Update `recorder 4.x` with the `recorder 3.5.0` changes and make
sure they are in sync.
- [x] Update lock file with `rush update --full` to get latest recorder
and test-credential packages
- [x] Test/fix packages
    - [x] recorder
    - [x] storage 
    - [x] template 
    - [x] '@azure-rest/synapse-access-control'
    - [x] '@azure/arm-resources'
    - [x] arm-links
    - [x] arm-resources
    - [x] event-grid
    - [x] template-dpg
    - [x] synpase packages
    - [ ] '@azure/identity' (future PR)
    - [x] '@azure/arm-eventgrid'
    - [x] '@azure/ai-text-analytics'

## Future Work
- [ ] Figure out identity tests/recordings
- [ ] Make sure CI pipelines for each of the services that are not
triggered in this PR get to green by either re-recording or tweaking the
recorder config for the package

---------

Co-authored-by: Scott Beddall (from Dev Box) <scbedd@microsoft.com>
2024-05-14 21:06:13 +00: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
Jeremy Meng 4e3aba1596
[Test][core] inline build:test commands into browser test scripts (#29411)
As far as I know for NodeJS the majority of our packages don't need
`build:test` as we either runs test on .ts files, or `build` script
already generates the .js files under `dist-esm`. Currently we only need
to build the test for browser testing.

This PR moves commands in `build:test` into the browser test scripts for
core packages, thus saving us from rebuilding when testing for NodeJS.
2024-05-02 14:48:38 -07:00
Matthew Podwysocki 984a148899
[template] Fix loupe issue (#29550)
### Packages impacted by this PR

- @azure/template

### Issues associated with this PR

- #29538

### Describe the problem that is addressed by this PR

Adding `loupe` directly to `template` and removing from `test-recorder`.

### 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?


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


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


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

### Checklists
- [ ] 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)
2024-05-01 17:24:22 -04:00
Jeremy Meng c52b93c788
[Test] skip template browser tests to unblock `js - core - ci` pipeline (#29539)
Template browser tests are broken (tracked by issue #29538). This PR
skips it to unblock CI.
2024-04-30 22:49:44 -07:00
Harsha Nalluru 77063733b0
[template-dpg] Suppress build failure (#29437)
Suppressing template-dpg failure to unblock
https://github.com/Azure/azure-sdk-for-js/issues/29436
2024-04-25 15:10:58 -07:00
Matthew Podwysocki 769c1b126e [EngSys] Update name of @azure-tools/test-utils ***NO_CI*** 2024-04-25 13:14:33 -07:00
Jeremy Meng e713574d65
[EngSys] remove `prettier` dev dependency from individual packages (#29378)
We already centralize prettier version in dev-tool and use `dev-tool run
vendored prettier` command to format. Looks that some packages brought
the dev dependency back during merge. This PR corrects those and also
includes the result of `rush format` on the repo.
2024-04-22 09:27:27 -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