Skip to content

Commit 7d38cde

Browse files
authored
Merge branch 'main' into tejaswi/codeowners-confidentialrelay
2 parents 74b5909 + ad25dc2 commit 7d38cde

2 files changed

Lines changed: 64 additions & 4 deletions

File tree

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: CRE settings schema reminder
2+
3+
on:
4+
pull_request:
5+
6+
permissions:
7+
contents: read
8+
pull-requests: write
9+
10+
jobs:
11+
reminder:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
18+
- name: Check for // Deprecated in settings.go diff
19+
id: deprecated
20+
run: |
21+
git fetch origin "${{ github.base_ref }}"
22+
if git diff "origin/${{ github.base_ref }}...HEAD" -- pkg/settings/cresettings/settings.go \
23+
| grep -E '^\+.*// Deprecated' -q; then
24+
echo "found=true" >> "$GITHUB_OUTPUT"
25+
else
26+
echo "found=false" >> "$GITHUB_OUTPUT"
27+
fi
28+
29+
- name: PR reminder
30+
if: steps.deprecated.outputs.found == 'true'
31+
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0
32+
with:
33+
issue-number: ${{ github.event.pull_request.number }}
34+
edit-mode: replace
35+
body-includes: "<!-- cre-settings-schema-reminder -->"
36+
body: |
37+
<!-- cre-settings-schema-reminder -->
38+
### CRE settings field deprecated
39+
40+
This PR adds `// Deprecated` in [`pkg/settings/cresettings/settings.go`](https://github.com/smartcontractkit/chainlink-common/blob/main/pkg/settings/cresettings/settings.go).
41+
42+
If the deprecated field is being replaced by a new one, then a smooth deployment migration requires:
43+
44+
1. Before deploying the code, any overridden values on the old field must be duplicated to the new field.
45+
2. Old field overrides must remain in-place and kept in-sync until all nodes are migrated.

pkg/workflows/wasm/host/standard_test.go

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ func TestStandardTeeRuntime(t *testing.T) {
529529
t.Parallel()
530530

531531
cfg := defaultNoDAGModCfg(t)
532-
m := makeTestModuleWithConfig(t, cfg)
532+
m := makeOptionalTestModuleWithConfig(t, cfg)
533533
mockExecutionHelper := mocks.NewMockExecutionHelper(t)
534534
mockExecutionHelper.EXPECT().GetWorkflowExecutionID().Return("id")
535535
mockExecutionHelper.EXPECT().GetNodeTime().RunAndReturn(func() time.Time {
@@ -612,14 +612,29 @@ func makeTestModule(t *testing.T) *module {
612612

613613
func makeTestModuleWithConfig(t *testing.T, cfg *ModuleConfig) *module {
614614
testName := strcase.ToSnake(t.Name()[len("TestStandard"):])
615-
return makeTestModuleByName(t, testName, cfg)
615+
return makeTestModuleByName(t, testName, cfg, true)
616616
}
617617

618-
func makeTestModuleByName(t *testing.T, testName string, cfg *ModuleConfig) *module {
618+
func makeOptionalTestModuleWithConfig(t *testing.T, cfg *ModuleConfig) *module {
619+
testName := strcase.ToSnake(t.Name()[len("TestStandard"):])
620+
return makeTestModuleByName(t, testName, cfg, false)
621+
}
622+
623+
func makeTestModuleByName(t *testing.T, testName string, cfg *ModuleConfig, required bool) *module {
619624
wasmName := path.Join(testName, "test.wasm")
620-
cmd := exec.Command("make", wasmName) // #nosec
621625
absPath, err := filepath.Abs(testPath)
622626
require.NoError(t, err, "Failed to get absolute path for test directory")
627+
628+
// An optional test is one whose SDK feature may not be released yet, in which case its
629+
// source directory won't exist. Skip only in that case; any other make failure (e.g. a
630+
// compilation error in an existing test) must still fail so we don't hide regressions.
631+
if !required {
632+
if _, statErr := os.Stat(filepath.Join(absPath, testName)); errors.Is(statErr, os.ErrNotExist) {
633+
t.Skipf("Optional test %q not found", testName)
634+
}
635+
}
636+
637+
cmd := exec.Command("make", wasmName) // #nosec
623638
cmd.Dir = absPath
624639

625640
output, err := cmd.CombinedOutput()

0 commit comments

Comments
 (0)