Skip to content

ci: add ts api guardian #12010

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Nov 30, 2018
Merged

ci: add ts api guardian #12010

merged 11 commits into from
Nov 30, 2018

Conversation

alan-agius4
Copy link
Collaborator

@alan-agius4 alan-agius4 commented Aug 27, 2018

This adds the API guardian in this repo.

Not this doesn't cover schematics/* packages. As I'd prefer to tackle that separately as it will require a some more changes and the PR will be way bigger.

At the moment, the packages covered are;

@angular-devkit/architect
@angular-devkit/benchmark
@angular-devkit/build-optimizer
@angular-devkit/core
@angular-devkit/schematics

@alan-agius4 alan-agius4 changed the title Build ts api guardian ci: add ts api guardian Aug 27, 2018
@alan-agius4
Copy link
Collaborator Author

alan-agius4 commented Aug 28, 2018

DId some more fixes for bazel in angular/angular

Blocked by:
angular/angular#25694
#11889, This requires TS 3 due that the guardian is using TS3 as a dependency and when tsc_wrapped rules tries to resolve the TS libs it fails since libs references have changed in TS3 and will get errors such as

error TS2318: Cannot find global type 'Array'.
error TS2318: Cannot find global type 'Boolean'.
error TS2318: Cannot find global type 'Function'.
error TS2318: Cannot find global type 'IArguments'.
error TS2318: Cannot find global type 'Number'.
error TS2318: Cannot find global type 'Object'.
error TS2318: Cannot find global type 'RegExp'.

@alan-agius4 alan-agius4 added target: major This PR is targeted for the next major release and removed state: WIP state: blocked labels Sep 6, 2018
@alexeagle
Copy link
Contributor

Is this ready to merge? Could you fix conflict?

Copy link
Contributor

@filipesilva filipesilva left a comment

Choose a reason for hiding this comment

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

The benchmark PR was also merged yesterday, and it includes a new package. It probably needs the same kind of codegen that was done in this PR.

@alan-agius4
Copy link
Collaborator Author

@alan-agius4
Copy link
Collaborator Author

Requires: angular/angular#26888

@angular angular deleted a comment from ngbot bot Nov 3, 2018
@alan-agius4 alan-agius4 dismissed filipesilva’s stale review November 8, 2018 14:56

Been updated and made it work on Windows

@alexeagle
Copy link
Contributor

angular/angular#26888 is green and marked for merge now

@alan-agius4 alan-agius4 added needs: discussion On the agenda for team meeting to determine next steps PR state: blocked labels Nov 20, 2018
@alan-agius4
Copy link
Collaborator Author

Marking as need further discussion to decide if we should go for api extractor.

@alan-agius4 alan-agius4 removed PR state: blocked needs: discussion On the agenda for team meeting to determine next steps labels Nov 21, 2018
@alan-agius4 alan-agius4 requested a review from hansl November 21, 2018 13:32
…tion

`ts-api-guardian` only support classic module resolution which means that we need to specify `index` so that the resolution works.
Copy link
Contributor

@filipesilva filipesilva left a comment

Choose a reason for hiding this comment

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

The bits that I'm familiar with LGTM.

I still think we should add information about how the API guardian affects the developer story. From the CI config it looks like to test is just bazel test ....

Is there anything else that needs to be done as a developer, like updating some of the golden files or something?

@alan-agius4
Copy link
Collaborator Author

alan-agius4 commented Nov 27, 2018

@filipesilva you need to update the golden files you if modify the public API.

If you touched parts of the API that were aliased, you might need to add these exports in the _golden_api files, since these won't be automatically discovered by the guardian.

I can create a readme. Maybe in the contributing section?

} catch (e) {
if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) {
return false;
export namespace fs {
Copy link
Contributor

Choose a reason for hiding this comment

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

We need a bigger discussion as export namespace ... is not considered best practices. See https://www.typescriptlang.org/docs/handbook/namespaces-and-modules.html#needless-namespacing

@hansl hansl added the needs: discussion On the agenda for team meeting to determine next steps label Nov 27, 2018
@hansl
Copy link
Contributor

hansl commented Nov 27, 2018

Need discussion as export namespace ... is not considered best practice and should be avoided.

Copy link
Contributor

@hansl hansl left a comment

Choose a reason for hiding this comment

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

Approving this to get moving.

@alan-agius4
Copy link
Collaborator Author

alan-agius4 commented Nov 28, 2018

One of the problems was that in some cases we have the same naming in 2 different "namespaces", and thus this would be that we cannot add it to the _golden_file unless they are properly namespace as they will collide.

If I recall correctly, it was terminal and colors.

@hansl hansl removed the needs: discussion On the agenda for team meeting to determine next steps label Nov 29, 2018
@vikerman vikerman merged commit 717b02f into angular:master Nov 30, 2018
@alan-agius4 alan-agius4 deleted the build_ts_api_guardian branch November 30, 2018 19:58
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants