pulumi / pulumi/pulumi-java

mod.types contains duplicate types

Open
#113 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area/codegen kind/engineering language/java
Dominant language
Java
Stars
85
Forks
26
Avg merge
11h 49m
Merged PRs (30d)
22

Description

Hello!

  • Vote on this issue by adding a 👍 reaction
  • To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already)

Issue details

Try running simple-plain-schema test upgraded to latest via https://github.com/pulumi/pulumi-java/pull/100

With some annotations, it's trying to add a class twice with the same content.

I think this might be indicative of some deeper issue around broken assumptions, worth revisiting.

[nix-shell:~/pulumi-java/pkg/codegen/jvm]$ PULUMI_ACCEPT=1 go test -test.v -run 'TestGeneratePackage/simple-plain-schema$'
PULUMI_ACCEPT=1 go test -test.v -run 'TestGeneratePackage/simple-plain-schema$'
=== RUN   TestGeneratePackage
=== RUN   TestGeneratePackage/simple-plain-schema
    sdk_driver.go:374: Simple schema with plain properties
path=src/main/java/io/pulumi/example/Utilities.java why=Utils hash=4114064235
path=README.md why=README hash=2166136261
path=src/main/java/io/pulumi/example/Provider.java why=Resource hash=2394552986
path=src/main/java/io/pulumi/example/ProviderArgs.java why=RArgs hash=630263832
path=src/main/java/io/pulumi/example/Component.java why=Resource hash=1434881424
path=src/main/java/io/pulumi/example/ComponentArgs.java why=RArgs hash=317195386
path=src/main/java/io/pulumi/example/DoFoo.java why=Function hash=3651202467
path=src/main/java/io/pulumi/example/inputs/DoFooArgs.java why=FunInputs hash=3512072270
Traversing mod.types with [example::Foo example::Foo•Input]
path=src/main/java/io/pulumi/example/inputs/Foo.java why=T1 hash=2131575687
path=src/main/java/io/pulumi/example/outputs/Foo.java why=T4 hash=1064242570
Traversing mod.types with [example::Foo example::Foo•Input]
path=src/main/java/io/pulumi/example/inputs/Foo.java why=T1 hash=2131575687
--- FAIL: TestGeneratePackage (0.00s)
    --- FAIL: TestGeneratePackage/simple-plain-schema (0.00s)
panic: fatal: An assertion has failed: duplicate file: src/main/java/io/pulumi/example/inputs/Foo.java why=T1 [recovered]
	panic: fatal: An assertion has failed: duplicate file: src/main/java/io/pulumi/example/inputs/Foo.java why=T1
Steps to reproduce

Expected:
Actual:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the named simple-plain-schema case with the provided PULUMI_ACCEPT=1 go test command and inspect pkg/codegen/jvm, including sdk_driver.go around the reported failure. Trace how mod.types is traversed and determine why the same Foo input produces duplicate output; done means the test completes without the duplicate-file assertion.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, java
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.