Skip to content

feature: allow specifying wildcards in the grpc.proto setting#90

Merged
rustatian merged 1 commit into
roadrunner-server:masterfrom
MaxSem:proto-wildcards
May 18, 2023
Merged

feature: allow specifying wildcards in the grpc.proto setting#90
rustatian merged 1 commit into
roadrunner-server:masterfrom
MaxSem:proto-wildcards

Conversation

@MaxSem

@MaxSem MaxSem commented May 17, 2023

Copy link
Copy Markdown
Contributor

Reason for This PR

ref: roadrunner-php/grpc#14

In large projects, maintaining the list of protofiles becomes a chore, allow using filename wildcards (e.g. path/to/*.proto)

Description of Changes

Expand wildcards in Config.InitDefaults()

License Acceptance

By submitting this pull request, I confirm that my contribution is made under
the terms of the MIT license.

PR Checklist

[Author TODO: Meet these criteria.]
[Reviewer TODO: Verify that these criteria are met. Request changes if not]

  • All commits in this PR are signed (git commit -s).
  • The reason for this PR is clearly provided (issue no. or explanation).
  • The description of changes is clear and encompassing.
  • Any required documentation changes (code and docs) are included in this PR.
  • Any user-facing changes are mentioned in CHANGELOG.md.
  • All added/changed functionality is tested.

@rustatian rustatian self-requested a review May 17, 2023 18:08
@rustatian rustatian added the enhancement New feature or request label May 17, 2023
@rustatian

Copy link
Copy Markdown
Member

Hey @MaxSem 👋🏻
Thanks for the contribution ⚡

Oh, I never saw this feature request 😢 Next time if that is something related to the server, please, send it to the https://github.com/roadrunner-server/roadrunner repository 👍🏻

Comment thread config.go
Comment thread config.go Outdated
@MaxSem MaxSem force-pushed the proto-wildcards branch 2 times, most recently from 2be4e23 to 4c647f5 Compare May 18, 2023 16:38
Signed-off-by: Max Semenik <maxsem.wiki@gmail.com>
@MaxSem MaxSem force-pushed the proto-wildcards branch from 4c647f5 to 8ecd391 Compare May 18, 2023 16:40
@rustatian rustatian self-requested a review May 18, 2023 16:54

@rustatian rustatian left a comment

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.

LGTM

@rustatian

Copy link
Copy Markdown
Member

Thanks @MaxSem 👍🏻

@rustatian rustatian merged commit 7549ee3 into roadrunner-server:master May 18, 2023
@rela589n

Copy link
Copy Markdown

Hi!

It looks like it only works for plain wildcards (e.g. not recursive).

The following, for example, wouldn't work:

proto:
    - "src/Support/Contracts/**/*.proto"

Another option I wanted to use is a "glob brace":

proto:
    - "src/Support/Contracts/{,*/,*/*/,*/*/*/}*.proto"

In this configuration, the inclusion of nested directories is defined for each level of deep.

Yet, this feature doesn't seem to be enabled. If we had used PHP's glob() function, it'd be enabled by GLOB_BRACE.

The only way I've managed to make it work is by following:

proto:
    - "src/Support/Contracts/*/*/*/*.proto"
    - "src/Support/Contracts/*/*/*.proto"
    - "src/Support/Contracts/*/*.proto"

It explicitly lists each glob pattern separately, one item per level of deep.

This's working, but IMO implementing **/ syntax would improve it, WDYT?

@rustatian

Copy link
Copy Markdown
Member

Hey @rela589n 👋🏻
Yeah, looks like a good addition to the existing functionality. Feel free to create a ticket for that or send me a PR 😃

@rela589n

Copy link
Copy Markdown

Where could I create a ticket?

@rustatian

Copy link
Copy Markdown
Member

https://github.com/roadrunner-server/roadrunner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants