Skip to content

build: flatten golden files directory #22967

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 1 commit into from
Jun 16, 2021

Conversation

crisbeto
Copy link
Member

Currently all the golden files for primary entry points are at the root which makes them easy to find, but the ones for secondary entry points are in sub-directories and all have the same name (autocomplete/testing.d.ts, button/testing.d.ts etc.) which is hard to look up and looks weird when browsing through the file system.

These changes flatten the directory so that the testing files are next to their entry points.

@google-cla google-cla bot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Jun 14, 2021
@@ -7,15 +7,19 @@ load("@npm//ts-api-guardian:index.bzl", "ts_api_guardian_test")
against the associated source entry point.
"""

def generate_test_targets(golden_files):
for golden_file in golden_files:
def generate_test_targets(targets):
Copy link
Member Author

Choose a reason for hiding this comment

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

I was split between doing this here or when generating the target names in tools/public_api_guard/BUILD.bazel. I decided to do it here, because even though it would be cleaner when generating the target names, I think that the slashes in the target name make sense, they just produce a weird directory structure when the golden is generated.

Currently all the golden files for primary entry points are at the root which makes them easy to find, but the ones for secondary entry points are in sub-directories and all have the same name (`autocomplete/testing.d.ts`, `button/testing.d.ts` etc.) which is hard to look up and looks weird when browsing through the file system.

These changes flatten the directory so that the testing files are next to their entry points.
@crisbeto crisbeto force-pushed the flat-golden-files branch from 5759850 to 20d1fe5 Compare June 14, 2021 06:10
@crisbeto crisbeto added merge safe P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent target: patch This PR is targeted for the next patch release labels Jun 14, 2021
@crisbeto crisbeto marked this pull request as ready for review June 14, 2021 06:24
@crisbeto crisbeto requested review from jelbourn and a team as code owners June 14, 2021 06:24
Copy link
Member

@devversion devversion left a comment

Choose a reason for hiding this comment

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

LGTM. I think it doesn't matter too much how these files are aligned; but I'd agree that this is more readable. I've kept them initially like that so that I can get nice auto-completion for secondary/tertiary entry-points (where I just append _api.accept for example)

@devversion devversion added the action: merge The PR is ready for merge by the caretaker label Jun 14, 2021
Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

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

LGTM

@wagnermaciel wagnermaciel merged commit 766b07e into angular:master Jun 16, 2021
wagnermaciel pushed a commit that referenced this pull request Jun 16, 2021
Currently all the golden files for primary entry points are at the root which makes them easy to find, but the ones for secondary entry points are in sub-directories and all have the same name (`autocomplete/testing.d.ts`, `button/testing.d.ts` etc.) which is hard to look up and looks weird when browsing through the file system.

These changes flatten the directory so that the testing files are next to their entry points.

(cherry picked from commit 766b07e)
@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 Jul 17, 2021
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 PR author has agreed to Google's Contributor License Agreement P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants