Skip to content

Commit 03228be

Browse files
committed
Read OFT params from env file
Adopted the way that up-spec reads in the OpenFastTrace configuration params from an env file in the local workspace. This makes it easier to adapt the file patterns and tags according to the evolvement of up-spec. The former way of using GitHub repo variables for that purpose was rather static and did not allow to use different sets of patterns on different branches in the repo.
1 parent 6cadbd9 commit 03228be

3 files changed

Lines changed: 52 additions & 12 deletions

File tree

.env.oft-latest

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Copyright (c) 2025 Contributors to the Eclipse Foundation
2+
#
3+
# See the NOTICE file(s) distributed with this work for additional
4+
# information regarding copyright ownership.
5+
#
6+
# This program and the accompanying materials are made available under the
7+
# terms of the Apache License Version 2.0 which is available at
8+
# https://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# SPDX-License-Identifier: Apache-2.0
11+
12+
# shellcheck disable=SC2148,SC2034
13+
14+
# The file patterns that specify the relevant parts of the latest uProtocol Specification
15+
# that this component is supposed to implement
16+
UP_SPEC_FILE_PATTERNS="up-spec/basics/uattributes.adoc up-spec/up-l1/README.adoc up-spec/up-l1/mqtt_5.adoc"
17+
18+
# The file patterns that specify this component's resources which contain specification items
19+
# that cover the requirements
20+
COMPONENT_FILE_PATTERNS="*.adoc *.md *.rs .github examples src tests"
21+
22+
OFT_FILE_PATTERNS="$UP_SPEC_FILE_PATTERNS $COMPONENT_FILE_PATTERNS"
23+
OFT_TAGS="_,TransportLayerImpl,TransportLayerImplPush"

.github/workflows/check-up-spec-compatibility.yaml renamed to .github/workflows/latest-up-spec-compatibility.yaml

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,10 @@
1212
# *******************************************************************************/
1313

1414
# Verifies that this crate can be built using the uProtocol Core API from up-spec's main branch.
15-
# Also performs requirements tracing using OpenFastTrace. For that purpose, the workflow requires
16-
# the UP_SPEC_OPEN_FAST_TRACE_FILE_PATTERNS variable to contain the file patterns to use for
17-
# invoking the "run-oft" Action.
15+
# Also performs requirements tracing using OpenFastTrace. The job fails if any of the two
16+
# activities fail.
1817

19-
name: uP Spec Compatibility
18+
name: Latest uP Spec Compatibility
2019

2120
on:
2221
schedule:
@@ -33,7 +32,7 @@ env:
3332
CARGO_TERM_COLOR: always
3433

3534
jobs:
36-
tests:
35+
requirements-tracing:
3736
runs-on: ubuntu-latest
3837
steps:
3938
- uses: actions/checkout@v4
@@ -49,16 +48,23 @@ jobs:
4948
git status
5049
cd "${{ github.workspace }}"
5150
52-
# run OpenFastTrace first because OFT will always succeed and produce
51+
- name: "Determine OpenFastTrace file patterns from .env file"
52+
uses: xom9ikk/dotenv@v2.3.0
53+
with:
54+
mode: "oft-latest"
55+
load-mode: strict
56+
57+
# run OpenFastTrace first because the action will always succeed and produce
5358
# a tracing report
5459
- name: Run OpenFastTrace
60+
id: run-oft
5561
uses: eclipse-uprotocol/ci-cd/.github/actions/run-oft@main
5662
with:
57-
file-patterns: "${{ vars.UP_SPEC_OPEN_FAST_TRACE_FILE_PATTERNS }} ${{ vars.UP_RUST_OPEN_FAST_TRACE_FILE_PATTERNS }}"
58-
tags: "_,TransportLayerImpl,TransportLayerImplPush"
63+
file-patterns: "${{ env.OFT_FILE_PATTERNS }}"
64+
tags: "${{ env.OFT_TAGS_}}"
5965

6066
# now try to build and run the tests which may fail if incomaptible changes
61-
# have been introduced in up-spec
67+
# have been introduced into the uProtocol Core API
6268
- uses: dtolnay/rust-toolchain@master
6369
with:
6470
toolchain: ${{ env.RUST_TOOLCHAIN }}
@@ -70,3 +76,13 @@ jobs:
7076
cargo nextest run --all-features
7177
# but it cannot execute doc tests
7278
cargo test --doc --all-features
79+
80+
# This step will only be run if the tests in the previous step have succeeded.
81+
# In that case, we use the exit code produced by the OFT run as the job's
82+
# overall outcome. This means that the job fails if the tests run successfully
83+
# but some of the requirements from up-spec are not covered.
84+
- name: Determine exit status
85+
env:
86+
OFT_EXIT_CODE: ${{ steps.run-oft.outputs.oft-exit-code }}
87+
run: |
88+
exit $OFT_EXIT_CODE

.github/workflows/nightly.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,9 @@ jobs:
4747
coverage:
4848
uses: eclipse-uprotocol/ci-cd/.github/workflows/rust-coverage.yaml@main
4949

50-
# disabled until up-spec repository has been tagged with the MQTT5 transport specification containing OFT spec items
51-
# requirements-tracing:
50+
# disabled until up-spec repository has been tagged with the MQTT5 transport specification containing
51+
# OFT spec items
52+
# current-spec-compliance:
5253
# uses: eclipse-uprotocol/ci-cd/.github/workflows/requirements-tracing.yaml@main
5354
# with:
54-
# oft-file-patterns: "${{ vars.UP_SPEC_OPEN_FAST_TRACE_FILE_PATTERNS }} ${{ vars.UP_RUST_OPEN_FAST_TRACE_FILE_PATTERNS }}"
55+
# env-file-suffix: "oft-current"

0 commit comments

Comments
 (0)