Skip to content
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

build: drop @cgrindel_bazel_starlib//updatesrc #4427

Merged
merged 3 commits into from
Oct 31, 2023

Conversation

oncilla
Copy link
Contributor

@oncilla oncilla commented Oct 30, 2023

Refactor the remaining targets that depended on @cgrindel_bazel_starlib//updatesrc. The repository has now been completely migrated to @aspect_bazel_lib//lib:write_source_files.

During the refactor, we dropped the functionality to write the source files in rules_openapi. Instead, the caller side can decide how to write the source files. This makes the rules more composable and easier to use. The functionality has been moved to a macro in private/mgmtapi/api.bzl, which is used inside of scionproto/scion.


This change is Reviewable

Refactor the remaining targets that depended on @cgrindel_bazel_starlib//updatesrc.
The repository has now been completely migrated to @aspect_bazel_lib//lib:write_source_files.

During the refactor, we dropped the functionality to write the source files in
rules_openapi. Instead, the caller side can decide how to write the source
files. This makes the rules more composable and easier to use. The functionality
has been moved to a macro in private/mgmtapi/api.bzl, which is used inside of
scionproto/scion.
Copy link
Contributor

@matzf matzf left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 22 of 22 files at r1, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @lukedirtwalker and @oncilla)


private/mgmtapi/api.bzl line 53 at r1 (raw file):

        name = name,
        srcs = out_files,
    )

Nit. This filegroup and the out_files seems redundant, it's identical to the files returned by _opeanpi_generate_go. I'd suggest to remove this for clarity and change the name of _openapi_generate_go to name.


rules_openapi/defs.bzl line 23 at r1 (raw file):

            '$(location " + name + "-no-header)' \
            '$(location " + name + ".bzl.gen.yml)' \
            '# GENERATED FILE DO NOT EDIT' \

Nit: can use $< and $@ shorthand for input and output files to make this shorter. Also, might not need the helper script, just

cmd = "(echo '# GENERATED FILE DO NOT EDIT'; cat $<) > $@",

Copy link
Collaborator

@lukedirtwalker lukedirtwalker left a comment

Choose a reason for hiding this comment

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

Reviewed 22 of 22 files at r1, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @matzf)


private/mgmtapi/api.bzl line 53 at r1 (raw file):

Previously, matzf (Matthias Frei) wrote…

Nit. This filegroup and the out_files seems redundant, it's identical to the files returned by _opeanpi_generate_go. I'd suggest to remove this for clarity and change the name of _openapi_generate_go to name.

+1


rules_openapi/defs.bzl line 23 at r1 (raw file):

Previously, matzf (Matthias Frei) wrote…

Nit: can use $< and $@ shorthand for input and output files to make this shorter. Also, might not need the helper script, just

cmd = "(echo '# GENERATED FILE DO NOT EDIT'; cat $<) > $@",

+1

Copy link
Contributor Author

@oncilla oncilla left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @lukedirtwalker)


private/mgmtapi/api.bzl line 53 at r1 (raw file):

Previously, lukedirtwalker (Lukas Vogel) wrote…

+1

Neat.

Done.


rules_openapi/defs.bzl line 23 at r1 (raw file):

Previously, lukedirtwalker (Lukas Vogel) wrote…

+1

Done.

Copy link
Collaborator

@lukedirtwalker lukedirtwalker left a comment

Choose a reason for hiding this comment

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

Reviewed 3 of 3 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @oncilla)

@oncilla oncilla enabled auto-merge (squash) October 31, 2023 08:39
Copy link
Contributor Author

@oncilla oncilla left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r3.
Reviewable status: all files reviewed (commit messages unreviewed), all discussions resolved (waiting on @oncilla)

Copy link
Contributor Author

@oncilla oncilla left a comment

Choose a reason for hiding this comment

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

Reviewed all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @oncilla)

@oncilla oncilla merged commit 576fa43 into scionproto:master Oct 31, 2023
4 checks passed
juagargi pushed a commit to netsec-ethz/scion that referenced this pull request Mar 8, 2024
Refactor the remaining targets that depended on @cgrindel_bazel_starlib//updatesrc.
The repository has now been completely migrated to @aspect_bazel_lib//lib:write_source_files.

During the refactor, we dropped the functionality to write the source files in
rules_openapi. Instead, the caller side can decide how to write the source
files. This makes the rules more composable and easier to use. The functionality
has been moved to a macro in private/mgmtapi/api.bzl, which is used inside of
scionproto/scion.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants