Skip to content

Conversation

shijiesheng
Copy link
Member

@shijiesheng shijiesheng commented Jun 24, 2025

What changed?

  • Fix lint
  • Makefile build rule will depend on lint rather than fmt

Why?

introduce best practice

How did you test it?

unit test

Potential risks

This is NOT a breaking change. Some files are touched but no API changes.

  • internal/worker.go added new Worker interface (copied from top level) and changed NewWorker() return. This NewWorker API is used in the top level and there is NO change in the API
  • internal/workflow.go only comment change to ignore the linter

I've copied the template anyway to avoid CI error

Detailed Description
[In-depth description of the changes made to the interfaces, specifying new fields, removed fields, or modified data structures]

Impact Analysis

  • Backward Compatibility: [Analysis of backward compatibility]
  • Forward Compatibility: [Analysis of forward compatibility]

Testing Plan

  • Unit Tests: [Do we have unit test covering the change?]
  • Persistence Tests: [If the change is related to a data type which is persisted, do we have persistence tests covering the change?]
  • Integration Tests: [Do we have integration test covering the change?]
  • Compatibility Tests: [Have we done tests to test the backward and forward compatibility?]

Rollout Plan

  • What is the rollout plan?
  • Does the order of deployment matter?
  • Is it safe to rollback? Does the order of rollback matter?
  • Is there a kill switch to mitigate the impact immediately?


.PHONY: build
build: $(BUILD)/fmt ## ensure all packages build
build: $(BUILD)/lint ## ensure all packages build
Copy link
Member

Choose a reason for hiding this comment

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

can we run both?

Copy link
Member Author

Choose a reason for hiding this comment

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

it's already running both. lint depends on fmt.

@shijiesheng
Copy link
Member Author

This is NOT a breaking change. Some files are touched but no API changes.

  • internal/worker.go added new Worker interface (copied from top level) and changed NewWorker() return. This NewWorker API is used in the top level and there is NO change in the API
  • internal/workflow.go only comment change to ignore the linter

)

type (
// Worker hosts workflow and activity implementations.
Copy link
Member

Choose a reason for hiding this comment

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

not following, where did this change come from? Are they intended to be part of the same lint PR?

Copy link
Member

Choose a reason for hiding this comment

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

ah, I missed that in the diff description earlier. What's the intent behind the copy?

Copy link
Member

Choose a reason for hiding this comment

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

these were defined in worker/worker.go. it seems they are moved here but not aliased in the previous place

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, it's copied from worker/worker.go. Basically internal package is missing this interface.
Alternatively we can use reference which has caused issues in go tooling (like mock) before.

Worker = internal.Worker

w.registry = newRegistry()
assert.Empty(t, w.registry.getRegisteredActivities())
assert.Empty(t, w.registry.GetRegisteredWorkflowTypes())
// assert.Empty(t, w.GetRegisteredActivities())
Copy link
Member

Choose a reason for hiding this comment

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

should these be asserted or cleaned up?

Copy link
Member Author

Choose a reason for hiding this comment

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

should be asserted. this is a miss

@shijiesheng shijiesheng merged commit 526cb2d into cadence-workflow:master Jun 25, 2025
11 checks passed
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