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 yamlfmt + yamllint #4077

Merged
merged 10 commits into from
Feb 12, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 1 addition & 2 deletions .github/actions/lint_code/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ runs:
uses: ./.github/actions/install_runner
- run: source venv/bin/activate
shell: bash
- name: Black, pylint and tailing whitespaces checks
- name: Black, pylint, tailing whitespaces, and yaml checks
shell: bash
run: ./format.sh --check
- if: ${{ failure() }}
Expand All @@ -34,4 +34,3 @@ runs:
run: |
npm install
npm run lint

6 changes: 6 additions & 0 deletions .yamlfmt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
formatter:
type: basic
include_document_start: true
indent: 2
pad_line_comments: 2
eof_newline: true
5 changes: 5 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
extends: relaxed

rules:
line-length: disable
key-ordering: disable
25 changes: 25 additions & 0 deletions format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,29 @@ else
fi
fi

echo "Running yamlfmt checks..."
if ! which yamlfmt > /dev/null; then
echo "yamlfmt is not installed, installing it (ETA 5s)"
GOBIN=$PWD/venv/bin/ go install github.com/google/yamlfmt/cmd/[email protected]
fi

echo "Running yamlfmt formatter..."
if [ "$COMMAND" == "fix" ]; then
yamlfmt manifests/
else
yamlfmt -lint manifests/
fi

echo "Running yamllint checks..."
if ! which ./venv/bin/yamllint > /dev/null; then
echo "yamllint is not installed, installing it (ETA 60s)"
./build.sh -i runner > /dev/null
fi

if ! ./venv/bin/yamllint -s manifests/; then
echo "yamllint checks failed. Please fix the errors above. 💥 💔 💥"
exit 1
fi


echo "All good, the system-tests CI will be happy! ✨ 🍰 ✨"
1 change: 1 addition & 0 deletions manifests/agent.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
tests/:
otel_tracing_e2e/:
test_e2e.py:
Expand Down
1 change: 1 addition & 0 deletions manifests/cpp.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
tests/:
apm_tracing_e2e/:
test_otel.py:
Expand Down
1 change: 1 addition & 0 deletions manifests/dd_apm_inject.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
tests/:
docker_ssi/:
test_docker_ssi.py:
Expand Down
9 changes: 5 additions & 4 deletions manifests/dotnet.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
tests/:
apm_tracing_e2e/:
test_otel.py:
Expand Down Expand Up @@ -168,7 +169,7 @@ tests/:
TestHeaderName: missing_feature
test_header_value.py:
TestHeaderValue:
'*': v2.39.0
'*': v2.39.0
test_kafka_key.py:
TestKafkaKey: missing_feature
test_kafka_value.py:
Expand Down Expand Up @@ -474,12 +475,12 @@ tests/:
Test_Otel_Tracer: v2.8.0
test_parametric_endpoints.py:
Test_Parametric_DDSpan_Add_Link: incomplete_test_app (add_link parametric endpoint is not implemented)
Test_Parametric_DDSpan_Set_Error: bug (APMAPI-778) # Set error endpoint does not set the error.type tag on spans
Test_Parametric_DDSpan_Set_Error: bug (APMAPI-778) # Set error endpoint does not set the error.type tag on spans
Test_Parametric_DDSpan_Set_Resource: incomplete_test_app (set_resource parametric endpoint is not implemented)
Test_Parametric_DDTrace_Baggage: incomplete_test_app (baggage endpoints are not implemented)
Test_Parametric_DDTrace_Current_Span: incomplete_test_app (current span endpoint is not implemented)
Test_Parametric_OtelSpan_Is_Recording: bug (APMAPI-778) # parametric endpoint attempts to retrieve spans by the `id` instead of `span_id`
Test_Parametric_OtelSpan_Set_Name: bug (APMAPI-778) # updates the operation name of the span not the resource name
Test_Parametric_OtelSpan_Is_Recording: bug (APMAPI-778) # parametric endpoint attempts to retrieve spans by the `id` instead of `span_id`
Test_Parametric_OtelSpan_Set_Name: bug (APMAPI-778) # updates the operation name of the span not the resource name
Test_Parametric_Otel_Baggage: incomplete_test_app (otel baggage endpoints are not implemented)
Test_Parametric_Otel_Current_Span: incomplete_test_app (otel current span endpoint are not implemented)
test_span_events.py: missing_feature
Expand Down
12 changes: 6 additions & 6 deletions manifests/golang.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
tests/:

apm_tracing_e2e/:
test_otel.py:
Test_Otel_Span:
Expand Down Expand Up @@ -492,7 +492,7 @@ tests/:
test_kafka.py:
Test_Kafka:
"*": irrelevant
net-http: v0.1 # real version not known
net-http: v0.1 # real version not known
test_kinesis.py:
Test_Kinesis_PROPAGATION_VIA_MESSAGE_ATTRIBUTES:
"*": irrelevant
Expand Down Expand Up @@ -606,8 +606,8 @@ tests/:
Test_Parametric_DDTrace_Baggage: missing_feature (baggage endpoints are not implemented)
Test_Parametric_DDTrace_Crash: missing_feature (crash endpoint is not implemented)
Test_Parametric_DDTrace_Current_Span: missing_feature (spans are stored in a local context, there is no global current span in the go tracer)
Test_Parametric_OtelSpan_Set_Name: bug (APMAPI-778) # The set_name endpoint should set the resouce name (not the span name)
Test_Parametric_OtelSpan_Start: bug (APMAPI-778) # String attributes are incorrectly stored/serialized in a list
Test_Parametric_OtelSpan_Set_Name: bug (APMAPI-778) # The set_name endpoint should set the resouce name (not the span name)
Test_Parametric_OtelSpan_Start: bug (APMAPI-778) # String attributes are incorrectly stored/serialized in a list
Test_Parametric_Otel_Baggage: missing_feature (otel baggage is not supported)
Test_Parametric_Otel_Current_Span: missing_feature (otel current span endpoint is not defined)
test_span_events.py: missing_feature
Expand All @@ -619,7 +619,7 @@ tests/:
Test_TelemetryInstallSignature: missing_feature
Test_TelemetrySCAEnvVar: v1.63.0-rc.1
test_trace_sampling.py:
Test_Trace_Sampling_Basic: v1.37.0 # TODO what is the earliest version?
Test_Trace_Sampling_Basic: v1.37.0 # TODO what is the earliest version?
Test_Trace_Sampling_Globs: v1.60.0
Test_Trace_Sampling_Globs_Feb2024_Revision: v1.64.0
Test_Trace_Sampling_Resource: v1.60.0
Expand Down Expand Up @@ -680,7 +680,7 @@ tests/:
Test_Span_Links_Flags_From_Conflicting_Contexts: missing_feature (implementation specs have not been determined)
Test_Span_Links_From_Conflicting_Contexts: missing_feature
Test_Span_Links_Omit_Tracestate_From_Conflicting_Contexts: missing_feature (implementation specs have not been determined)
Test_Synthetics_APM_Datadog: bug (APMAPI-901) # the incoming headers are considered invalid
Test_Synthetics_APM_Datadog: bug (APMAPI-901) # the incoming headers are considered invalid
test_graphql.py: missing_feature
test_identify.py:
Test_Basic: v1.37.0
Expand Down
Loading