Skip to content

build(aio): improve ignored example file error message#19265

Closed
petebacondarwin wants to merge 2 commits into
angular:masterfrom
petebacondarwin:aio-improve-missing-example-error-message
Closed

build(aio): improve ignored example file error message#19265
petebacondarwin wants to merge 2 commits into
angular:masterfrom
petebacondarwin:aio-improve-missing-example-error-message

Conversation

@petebacondarwin
Copy link
Copy Markdown
Contributor

This will provide a better error message for @wardbell in #18707 (comment)

@petebacondarwin petebacondarwin added comp: aio action: review The PR is still awaiting reviews from at least one requested reviewer labels Sep 19, 2017
@petebacondarwin
Copy link
Copy Markdown
Contributor Author

Consider reviewing the changes to the spec files with whitespace changes ignored.

@mary-poppins
Copy link
Copy Markdown

You can preview b124ea4 at https://pr19265-b124ea4.ngbuilds.io/.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

AFAICT, examplePaths will be relative, but filteredExamplePaths will be absolute.
So, this test won't work (and the current tests won't catch this).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I believe that you know wrong in this case.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think the problem stems from the resolve mapping, right? I tested this by using yarn docs with changes to gitignore. I suspect that the resolve is effectively a noop.

Copy link
Copy Markdown
Member

@gkalpak gkalpak Sep 19, 2017

Choose a reason for hiding this comment

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

I said "AFAICT" not "AFAIK" 😃 (I never know wrong 😛)

So, which part is wrong? exampleFiles being relative or filteredExampleFiles being absolute?
(I made my assumption based on this line, btw.)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Damn it you are right!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sorry 😳

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The result was false positives, I was reporting examples as ignored when they were actually missing.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Actually as it turned out, it does indeed work as it is. The point is that if you get to calling the isExampleFiltered function then you already know that the file will not appear in the filteredExamplePaths list, so it doesn't matter that this will never match!

@petebacondarwin petebacondarwin force-pushed the aio-improve-missing-example-error-message branch from b124ea4 to 8ccf5b7 Compare September 19, 2017 10:35
@petebacondarwin
Copy link
Copy Markdown
Contributor Author

Hopefully this should be better

@petebacondarwin petebacondarwin force-pushed the aio-improve-missing-example-error-message branch from 8ccf5b7 to 84cdc18 Compare September 19, 2017 10:36
@mary-poppins
Copy link
Copy Markdown

You can preview 84cdc18 at https://pr19265-84cdc18.ngbuilds.io/.

@mary-poppins
Copy link
Copy Markdown

You can preview 8ccf5b7 at https://pr19265-8ccf5b7.ngbuilds.io/.

Copy link
Copy Markdown
Member

@gkalpak gkalpak left a comment

Choose a reason for hiding this comment

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

A couple of optional nitpicks.
LGTM otherwise 👍

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Minor: This is a little confusing imo (as pre-filtered could mean that the paths were filtered in advance 😁).
Maybe Unfiltered or All?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Unused.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Consider adding a comment that this method is expected to be called with paths that are not "filteredExamplePaths".

@gkalpak gkalpak added action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Sep 19, 2017
@petebacondarwin petebacondarwin force-pushed the aio-improve-missing-example-error-message branch from 84cdc18 to b11f8e2 Compare September 19, 2017 11:43
@petebacondarwin
Copy link
Copy Markdown
Contributor Author

petebacondarwin commented Sep 19, 2017

I reworked it completely. PTAL @gkalpak

@mary-poppins
Copy link
Copy Markdown

You can preview b11f8e2 at https://pr19265-b11f8e2.ngbuilds.io/.

Copy link
Copy Markdown
Member

@gkalpak gkalpak left a comment

Choose a reason for hiding this comment

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

LGTM

},
/**
* Call this method to find out if an example was ignored.
* @param path a relative path to the example file to test for being ignored.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Might be worth mentioning that the path is relative to the examples folder.

@petebacondarwin petebacondarwin added action: merge The PR is ready for merge by the caretaker and removed action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews labels Sep 20, 2017
@IgorMinar IgorMinar added the target: patch This PR is targeted for the next patch release label Sep 20, 2017
@IgorMinar IgorMinar closed this in 988b9f8 Sep 20, 2017
@petebacondarwin
Copy link
Copy Markdown
Contributor Author

Looking for a cherry-pick to stable too @IgorMinar

IgorMinar pushed a commit to IgorMinar/angular that referenced this pull request Sep 21, 2017
IgorMinar pushed a commit to IgorMinar/angular that referenced this pull request Sep 21, 2017
@petebacondarwin
Copy link
Copy Markdown
Contributor Author

Landed in stable as 9624fda

@petebacondarwin petebacondarwin deleted the aio-improve-missing-example-error-message branch September 28, 2017 12:25
@angular-automatic-lock-bot
Copy link
Copy Markdown

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

action: merge The PR is ready for merge by the caretaker cla: yes target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants