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

add multi-module gen support #402

Merged
merged 2 commits into from
Oct 21, 2024
Merged

Conversation

DannyBrito
Copy link
Contributor

What this PR does / why we need it:

Which issue(s) this PR fixes (optional, using fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when the PR gets merged):
Fixes #392

Special notes for your reviewer:

@DannyBrito DannyBrito requested a review from a team as a code owner October 14, 2024 21:12
@DannyBrito
Copy link
Contributor Author

This is failing.
In a scenario that in theory it should work:

  src:
    path: test/fixtures/multi-modules
    context: {}
    generate:
      - gomod:
          paths:
            - module1
            - module2
        subpath: project

load.go Outdated Show resolved Hide resolved
test/fixtures/multi-go-modules.yml Outdated Show resolved Hide resolved
@cpuguy83
Copy link
Member

Also looks like this needs a go generate ./... so it updates the json schema.

Otherwise this seems like its working.

@DannyBrito DannyBrito force-pushed the dannybrito/multimodule branch from b121157 to bf7ce1c Compare October 18, 2024 19:59
@DannyBrito DannyBrito requested a review from cpuguy83 October 18, 2024 20:33
test/source_test.go Outdated Show resolved Hide resolved
if g.Gomod.Paths == nil {
paths = []string{"."}
}
states := make([]llb.State, 0, len(paths))
Copy link
Member

Choose a reason for hiding this comment

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

Since there can be duplicate modules that need to get downloaded, instead of using multiple states and merging them, can we build up a single state?

test/source_test.go Outdated Show resolved Hide resolved
@DannyBrito DannyBrito requested a review from cpuguy83 October 21, 2024 16:20
@cpuguy83 cpuguy83 merged commit 295356e into Azure:main Oct 21, 2024
9 checks passed
@DannyBrito DannyBrito deleted the dannybrito/multimodule branch December 17, 2024 17:20
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.

[REQ] Support multi-module repos for gomod generator
2 participants