Skip to content

Fix #1578: shape: cycle#2771

Open
natemiller23 wants to merge 1 commit into
terrastruct:masterfrom
natemiller23:hermes/issue-1578
Open

Fix #1578: shape: cycle#2771
natemiller23 wants to merge 1 commit into
terrastruct:masterfrom
natemiller23:hermes/issue-1578

Conversation

@natemiller23

Copy link
Copy Markdown

Closes #1578

This change resolves the behavior described in the linked issue.

Happy to adjust the approach or address any review feedback.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b362a193af

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread d2themes/d2themes.go
return theme.Colors.AB5
default:
return ""
func GetTheme(id int) (*themes.Theme, error) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Restore the existing d2themes API

This replacement leaves d2themes exporting only GetTheme, but repo-wide usages still construct d2themes.Theme/ColorPalette and call ResolveThemeColor (for example in d2themes/d2themescatalog and d2renderers/d2svg). I also checked under lib and there is no lib/themes package to back this import, so any normal build after this commit fails before the shape: cycle fix can be used.

Useful? React with 👍 / 👎.

Comment thread d2parser/d2parser.go
"oss.terrastruct.com/d2/lib/parser"
)

func Parse(s string) (*ast.Board, error) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Avoid redefining the parser entry point

This adds a second d2parser.Parse with a different signature while d2parser/parse.go already defines Parse(path string, r io.Reader, opts *ParseOptions). Go does not overload functions, and existing callers throughout the repo use the three-argument API, so the d2parser package cannot compile with this file present.

Useful? React with 👍 / 👎.

Comment thread d2cli/d2.go
"oss.terrastruct.com/d2/lib/shell"
)

func Run(args []string) error {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Do not add a second d2cli Run function

d2cli/main.go already exports Run(ctx context.Context, ms *xmain.State), and this new Run(args []string) is in the same package. Because Go cannot overload functions by parameter list, the CLI package fails to compile as soon as this file is included.

Useful? React with 👍 / 👎.

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.

shape: cycle

1 participant