Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/ci-client-cyclic-deps-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,8 @@ jobs:
issue_number: prNumber,
body: message
});

# Fail the workflow if cyclic dependencies are found
- name: Fail the workflow if cyclic dependencies are found
if: steps.compare-deps.outputs.has_more_cyclic_deps == 'true' && steps.changed-files.outputs.any_changed == 'true'
run: exit 1
2 changes: 2 additions & 0 deletions .github/workflows/quality-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ jobs:
client-prettier,
client-unit-tests,
client-lint,
client-check-cyclic-deps,
]
if: always()
runs-on: ubuntu-latest
Expand All @@ -116,6 +117,7 @@ jobs:
"${{ needs.client-build.result }}" == "failure" || \
"${{ needs.client-prettier.result }}" == "failure" || \
"${{ needs.client-unit-tests.result }}" == "failure" || \
"${{ needs.client-check-cyclic-deps.result }}" == "failure" || \
"${{ needs.client-lint.result }}" == "failure" ]]; then
echo "Quality checks failed";
exit 1;
Expand Down
8 changes: 8 additions & 0 deletions app/client/src/instrumentation/dummy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import type { Attributes as OTELAttributes } from "@opentelemetry/api";
import type { Span } from "./types";
export type Attributes = OTELAttributes;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Break the cyclic dependency with types.ts

There's a circular dependency between this file and types.ts. This file imports Span from ./types while types.ts imports Attributes from here.

Consider moving common types to a separate types file to break this cycle. For example:

- import type { Span } from "./types";
- export type Attributes = OTELAttributes;
+ // Move to a new file: commonTypes.ts
+ export type Attributes = OTELAttributes;
+ export type Span = OTELSpan;

Committable suggestion skipped: line range outside the PR's diff.


export interface DummyType {
attributes: OTELAttributes;
span: Span;
}
11 changes: 4 additions & 7 deletions app/client/src/instrumentation/types.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
import type {
Attributes as OTELAttributes,
TimeInput,
Span as OTELSpan,
} from "@opentelemetry/api";
import type { TimeInput, Span as OTELSpan } from "@opentelemetry/api";
import type { Attributes as DummyAttributes } from "./dummy";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Remove circular dependency with dummy.ts

This file imports from ./dummy which creates a circular dependency. This could cause issues with bundling and type resolution.

Move shared types to a common file:

- import type { Attributes as DummyAttributes } from "./dummy";
+ import type { Attributes } from "./commonTypes";

Committable suggestion skipped: line range outside the PR's diff.


export interface WebworkerSpanData {
attributes: OTELAttributes;
attributes: DummyAttributes;
spanName: string;
startTime: TimeInput;
endTime: TimeInput;
}

export type Attributes = OTELAttributes;
export type Span = OTELSpan;
export type Attributes = DummyAttributes;