Skip to content

[core-client] Fix Core client nightly#18977

Merged
joheredi merged 2 commits intoAzure:mainfrom
joheredi:core-client-nightly
Dec 6, 2021
Merged

[core-client] Fix Core client nightly#18977
joheredi merged 2 commits intoAzure:mainfrom
joheredi:core-client-nightly

Conversation

@joheredi
Copy link
Member

@joheredi joheredi commented Dec 6, 2021

TL;DR - Nightly builds are broken because core-client now depends on a property not existing in the latest published in NPM. Updating the dependency on core-rest-pipeline so that nightly ci links to the same alpha version of core-rest-pipeline.

Details
Core pipeline nightly builds are failing with the following error:

src/authorizeRequestOnClaimChallenge.ts(67,37): error TS2339: Property 'logger' does not exist on type 'AuthorizeRequestOnChallengeOptions'.
test/authorizeRequestOnClaimChallenge.spec.ts(383,7): error TS2345: Argument of type '{ getAccessToken(scopes: string[], getTokenOptions: GetTokenOptions): Promise<{ token: string; expiresOnTimestamp: number; }>; scopes: never[]; response: { ...; }; request: PipelineRequest; logger: any; }' is not assignable to parameter of type 'AuthorizeRequestOnChallengeOptions'.
Object literal may only specify known properties, and 'logger' does not exist in type 'AuthorizeRequestOnChallengeOptions'.
test/authorizeRequestOnClaimChallenge.spec.ts(429,7): error TS2345: Argument of type '{ getAccessToken(scopes: string[], getTokenOptions: GetTokenOptions): Promise<{ token: string; expiresOnTimestamp: number; }>; scopes: never[]; response: { ...; }; request: PipelineRequest; logger: any; }' is not assignable to parameter of type 'AuthorizeRequestOnChallengeOptions'.
Object literal may only specify known properties, and 'logger' does not exist in type 'AuthorizeRequestOnChallengeOptions'.

The problem started a few weeks ago when #18467 was merged. It adds a logger property to AuthorizeRequestOnChallengeOptions, AuthorizeRequestOptions and BearerTokenAuthenticationPolicyOptions . In the same PR @azure/core-client starts consuming this new property *authorizeRequestOnClaimChallenge.ts).

However @azure/core-client's dependency on @azure/core-rest-pipeline wasn't updated and remained on ^1.1.0. In local development and regular CIs this works fine because RUSH would link the local versions of the SDKs which would contain the newest changes. The problem comes when creating dev-versions, the logic in our tooling determines that ^1.1.0 is enough and doesn't update @azure/core-client to the current alpha version, this makes the dependency on @azure/core-rest-pipeline to point to the latest in NPM 1.3.2 which doesn't have the new property and causes the build break.

The fix is simple, just need to update the dependency on core-rest-pipeline to ^1.3.3 so that nightly build tooling would link it to the alpha versions being produced.

Ran a test pipeline (link) based on these changes and the Build libraries step works fine (canceled to avoid releasing alpha builds off an unmerged branch)

@joheredi
Copy link
Member Author

joheredi commented Dec 6, 2021

/azp run js - core

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

@sadasant sadasant left a comment

Choose a reason for hiding this comment

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

I think this should be fine. Next time a release date comes, we should release these two packages together anyway.

Copy link
Member

@deyaaeldeen deyaaeldeen left a comment

Choose a reason for hiding this comment

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

Thanks for catching this!

@joheredi joheredi merged commit ce385d4 into Azure:main Dec 6, 2021
jeremymeng added a commit to jeremymeng/azure-sdk-for-js that referenced this pull request Dec 21, 2021
while we may want to handle setting dev versions better, this unblocks the
nightly build pipeline similarly to what PR Azure#18977 did.
jeremymeng added a commit that referenced this pull request Dec 21, 2021
while we may want to handle setting dev versions better, this unblocks the
nightly build pipeline similarly to what PR #18977 did.
azure-sdk pushed a commit to azure-sdk/azure-sdk-for-js that referenced this pull request May 12, 2022
[Microsoft.KubernetesConfiguration] Add 200 OK to PATCH apis (Azure#18977)

* Add response codes to patch apis

* Examples for patch of extension and configuration
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants