Skip to content

Commit b1508b1

Browse files
committed
Merge remote-tracking branch 'origin/master' into pr/swan-amazon/37015
2 parents 3046d6a + 6ffcd19 commit b1508b1

File tree

229 files changed

+28940
-1842
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

229 files changed

+28940
-1842
lines changed

.github/PULL_REQUEST_TEMPLATE.md

+11-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
1-
> !!!!!!!!!! Please delete the instructions below and replace with PR description
1+
> !!!!!!!!!! Please delete the instructions below and replace with PR
2+
> description
23
>
3-
> If you have an issue number, please use a syntax of
4-
> `Fixes #12345` and a brief change description
4+
> If you have an issue number, please use a syntax of `Fixes #12345` and a brief
5+
> change description
56
>
6-
> If you do not have an issue number, please have a good description of
7-
> the problem and the fix. Help the reviewer understand what to expect.
7+
> If you do not have an issue number, please have a good description of the
8+
> problem and the fix. Help the reviewer understand what to expect.
9+
>
10+
> Complete/append to the `### Testing` section below, to describe how testing
11+
> was done. See
12+
> <https://github.com/project-chip/connectedhomeip/blob/master/CONTRIBUTING.md#pull-requests>
813
>
914
> Make sure you delete these instructions (to prove you have read them).
1015
>
1116
> !!!!!!!!!! Instructions end
1217
18+
#### Testing

.github/workflows/cancel_workflows_for_pr.yaml

+4-3
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,16 @@ jobs:
3535
python-version: '3.12'
3636
- name: Setup pip modules we use
3737
run: |
38-
pip install \
38+
python3 -m venv venv
39+
venv/bin/pip3 install \
3940
click \
4041
coloredlogs \
4142
python-dateutil \
4243
pygithub \
43-
&& echo "DONE installint python prerequisites"
44+
&& echo "DONE installing python prerequisites"
4445
- name: Cancel runs
4546
run: |
46-
scripts/tools/cancel_workflows_for_pr.py \
47+
venv/bin/python3 scripts/tools/cancel_workflows_for_pr.py \
4748
--gh-api-token "${{ secrets.GITHUB_TOKEN }}" \
4849
--require "Restyled" \
4950
--require "Lint Code Base" \

.github/workflows/docbuild.yaml

+4-3
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,18 @@ jobs:
2929
- name: Install Python
3030
uses: actions/setup-python@v5
3131
with:
32-
python-version: 3.8
32+
python-version: 3.12
3333
cache-dependency-path: matter/docs/requirements.txt
3434
cache: pip
3535
- name: Install base dependencies
3636
working-directory: matter
3737
run: |
38-
sudo pip3 install -U pip
39-
pip3 install -r docs/requirements.txt
38+
python3 -m venv venv
39+
venv/bin/pip3 install -r docs/requirements.txt
4040
- name: Build documentation
4141
working-directory: matter/docs
4242
run: |
43+
source ../venv/bin/activate
4344
mkdir -p _build/src
4445
make html
4546
touch _build/html/.nojekyll

.github/workflows/examples-bouffalolab.yaml

+19-1
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,26 @@ jobs:
116116
- name: Clean out build output
117117
run: rm -rf ./out
118118

119+
- name: Build example BL702L Contact Sensor
120+
timeout-minutes: 30
121+
run: |
122+
./scripts/run_in_build_env.sh \
123+
"./scripts/build/build_examples.py \
124+
--target bouffalolab-bl704ldk-contact-sensor-thread-mtd-littlefs-mfd \
125+
build \
126+
--copy-artifacts-to out/artifacts \
127+
"
128+
- name: Prepare some bloat report from the previous builds
129+
run: |
130+
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
131+
bl702l bl702l+mfd+littlefs contact-sensor-app \
132+
out/artifacts/bouffalolab-bl704ldk-contact-sensor-thread-mtd-littlefs-mfd/chip-bl702l-contact-sensor-example.out \
133+
/tmp/bloat_reports/
134+
- name: Clean out build output
135+
run: rm -rf ./out
136+
119137
- name: Uploading Size Reports
120138
uses: ./.github/actions/upload-size-reports
121139
if: ${{ !env.ACT }}
122140
with:
123-
platform-name: BouffaloLab
141+
platform-name: BouffaloLab

.github/workflows/pr-validation.yaml

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: PR validity
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened, edited]
6+
7+
jobs:
8+
check_testing_header:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Check for `### Testing` section in PR
12+
id: check-testing
13+
continue-on-error: true
14+
run: |
15+
cat >/tmp/pr-summary.txt << "EndMarkerForPrSummary"
16+
${{ github.event.pull_request.body }}
17+
EndMarkerForPrSummary
18+
19+
python -c 'import sys; pr_summary = open("/tmp/pr-summary.txt", "rt").read(); sys.exit(0 if "### Testing" in pr_summary else 1)'
20+
21+
- name: Check for PR starting instructions
22+
id: check-instructions
23+
continue-on-error: true
24+
run: |
25+
cat >/tmp/pr-summary.txt << "EndMarkerForPrSummary"
26+
${{ github.event.pull_request.body }}
27+
EndMarkerForPrSummary
28+
29+
python -c 'import sys; pr_summary = open("/tmp/pr-summary.txt", "rt").read(); sys.exit(1 if "Make sure you delete these instructions" in pr_summary else 0)'
30+
31+
# NOTE: comments disabled for now as separate permissions are required
32+
# failing CI step may be sufficient to start (although it contains less information about why it failed)
33+
34+
# - name: Add comment (missing instructions)
35+
# if: steps.check-instructions.outcome == 'failure'
36+
# uses: actions/github-script@v6
37+
# with:
38+
# github-token: ${{ secrets.GITHUB_TOKEN }}
39+
# script: |
40+
# github.rest.issues.createComment({
41+
# issue_number: context.issue.number,
42+
# owner: context.repo.owner,
43+
# repo: context.repo.repo,
44+
# body: 'Please make sure to delete starter instructions from your PR summary and replace them with a descriptive summary.'
45+
# })
46+
47+
- name: Fail if PR instructions were not deleted
48+
if: steps.check-instructions.outcome == 'failure'
49+
run: |
50+
python -c 'import sys; print("PR instructions were not replaced"); sys.exit(1)'
51+
52+
# - name: Add comment (missing testing)
53+
# if: steps.check-testing.outcome == 'failure'
54+
# uses: actions/github-script@v6
55+
# with:
56+
# github-token: ${{ secrets.GITHUB_TOKEN }}
57+
# script: |
58+
# github.rest.issues.createComment({
59+
# issue_number: context.issue.number,
60+
# owner: context.repo.owner,
61+
# repo: context.repo.repo,
62+
# body: 'Please add a `### Testing` section to your PR summary describing the testing performed. See https://github.com/project-chip/connectedhomeip/blob/master/CONTRIBUTING.md#pull-requests'
63+
# })
64+
65+
- name: Fail if `### Testing` section not in PR
66+
if: steps.check-testing.outcome == 'failure'
67+
run: |
68+
python -c 'import sys; print("Testing section missing (test failed)"); sys.exit(1)'
69+

.github/workflows/protocol_compatibility.yaml

+4-5
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ jobs:
3030
- name: Setup python
3131
uses: actions/setup-python@v5
3232
with:
33-
python-version: 3.11
33+
python-version: 3.12
3434
- name: Install dependencies
3535
run: |
36-
python -m pip install --upgrade pip
37-
pip install click coloredlogs lark
36+
python3 -m venv venv
37+
venv/bin/pip3 install click coloredlogs lark
3838
- name: Create old/new copies
3939
run: |
4040
mkdir -p out
@@ -45,5 +45,4 @@ jobs:
4545
patch -p1 <out/patch.diff
4646
- name: Check backwards compatibility
4747
run: |
48-
scripts/backwards_compatibility_checker.py out/old_version.matter out/new_version.matter
49-
48+
venv/bin/python3 scripts/backwards_compatibility_checker.py out/old_version.matter out/new_version.matter

.github/workflows/tests.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ jobs:
111111
src/app/zap-templates/zcl/data-model/chip/boolean-state-cluster.xml \
112112
src/app/zap-templates/zcl/data-model/chip/actions-cluster.xml \
113113
src/app/zap-templates/zcl/data-model/chip/bridged-device-basic-information.xml \
114+
src/app/zap-templates/zcl/data-model/chip/camera-av-settings-user-level-management-cluster.xml \
114115
src/app/zap-templates/zcl/data-model/chip/camera-av-stream-management-cluster.xml \
115116
src/app/zap-templates/zcl/data-model/chip/chip-ota.xml \
116117
src/app/zap-templates/zcl/data-model/chip/chip-types.xml \

CONTRIBUTING.md

+93
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,99 @@ This will trigger the continuous-integration checks. You can view the results in
160160
the respective services. Note that the integration checks will report failures
161161
on occasion.
162162

163+
#### Pull requests
164+
165+
Aim to make pull requests easy to read both when viewed in a list (title only)
166+
as well as clear in content within the description.
167+
168+
##### Title formatting
169+
170+
Describe the change as a one-line in some descriptive manner. Add sufficient
171+
context for a reader to understand what is improved. If platform-specific
172+
consider adding the platform as a prefix, like `[Android]` or any other tags may
173+
be useful for quick filtering like `[TC-ABC-1.2]` to tag test changes.
174+
175+
Examples of descriptive titles:
176+
177+
- `[Silabs] Fix compile of SiWx917 if LED and BUTTON are disabled`
178+
- `[Telink] Update build Dockerfile with new Zeprhy SHA: c05c4.....`
179+
- `General Commissioning Cluster: use AttributeAccessInterface/CommandHandlerInterface for processing`
180+
- `Scenes Management/CopyScene: set access as manage instead of default to match the spec`
181+
- `Fix build errors due to ChipDeviceEvent default constructor not being available`
182+
- `Fix crash during DNSSD processing due to malformed packet`
183+
- `[NRF] Fix crash due to stack overflow during logging for PW-RPC builds`
184+
- `[TC-ABC-2.3] added new python test case based on test plan`
185+
- `[TC-ABC] migrate tests from yaml to python`
186+
187+
Examples of titles that are vague (not clear what the change is, one would need
188+
to open the pull request for details or open additional issue in GitHub)
189+
190+
- `Work on issue 1234`
191+
- `Fix android JniTypeWrappers`
192+
- `Fix segfault in BLE`
193+
- `Fix TC-ABC-1.2`
194+
- `Update Readme`
195+
196+
##### Summary contents
197+
198+
Ensure that there is sufficient detail in issue summaries to make the content of
199+
the PR clear:
200+
201+
- a `TLDR` of the change content. This is a judgment call on details,
202+
generally you should include a what was changed and why. The change is
203+
trivial/short, this can be very short (i.e. "fixed typos" is perfectly
204+
acceptable, however if changing 100-1000s of line, the areas of changes
205+
should be explained)
206+
- If a crash/error is fixed, explain the root cause and if the fix is not
207+
obvious (again, judgment call), explain why the given approach was taken.
208+
- Help the reviewer out with any notable information (specific platform
209+
issues, extra thoughts or requests for feedback or gotchas on tricky code,
210+
followup work or PR dependencies)
211+
- TIP: use the syntax of `Fixes #....` to mark issues completed on PR merge or
212+
use `#...` to reference issues that are addressed.
213+
- TIP: prefer adding some brief description (especially about the content of
214+
the changes) instead of just referencing an issue (helps reviewers get
215+
context faster without extra clicks).
216+
217+
##### Testing section
218+
219+
All Pull Requests **MUST** contain a `#### Testing` section that describes how
220+
the pull request was tested. Ideally every test should have automated testing,
221+
however for platform specific changes or hardware-specific issues we may not be
222+
able to have such tests (e.g. we may not BLE or NFC capability in CI). As such,
223+
manual testing is acceptable, however the description has to be detailed
224+
intentionally to avoid a bias towards marking pull requests as "manually tested"
225+
out of convenience.
226+
227+
- Automated testing
228+
229+
**AWESOME**. You can say "unit tests added/updated" or "Integration tests
230+
updated to cover functionality" or "existing tests already cover this" (make
231+
sure they do. Integration tests often only cover happy paths).
232+
233+
Add any notes on not covered things. It is a judgment call on how much can
234+
be covered as 100% sounds great however not always possible.
235+
236+
- Manual testing
237+
238+
Describe why automated testing is impossible in the current CI environment
239+
or difficult to add. If adding later, reference the issue to add automation
240+
and a timeline for adding such automation.
241+
242+
Describe in **DETAIL** how manual testing was done: what environment, what
243+
builds were used (`build-example` names are ok such as
244+
`flashed qpg-qpg6105-light` and `used linux-x64-chip-tool-clang`). Describe
245+
commands ran (often chip-tool) and physical interaction and what was
246+
observed.
247+
248+
- Trivial/obvious change
249+
250+
In rare cases the change is trivial (e.g. fixing a typo in a `Readme.md`).
251+
Scripts still require a `#### Testing` section however you can be brief like
252+
`N/A` or `checked new URL opens`. Note that these cases are rare - e.g.
253+
fixing a typo in an ID still requires some description on how you checked
254+
that the new ID takes effect.
255+
163256
### Review Requirements
164257

165258
#### Documentation Best Practices

docs/ids_and_codes/zap_clusters.md

+1
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ Generally regenerate using one of:
131131
| 1296 | 0x510 | ContentAppObserver |
132132
| 1360 | 0x550 | ZoneManagement |
133133
| 1361 | 0x551 | CameraAvStreamManagement |
134+
| 1362 | 0x552 | CameraAvSettingsUserLevelManagement |
134135
| 1363 | 0x553 | WebRTCTransportProvider |
135136
| 1364 | 0x554 | WebRTCTransportRequestor |
136137
| 1366 | 0x556 | Chime |

docs/issue_triage.md

+1
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ types or functionality) as well as individual examples.
137137
| `examples/rvc-app` | | UNMAINTAINED |
138138
| `examples/smoke-co-alarm-app` | | UNMAINTAINED |
139139
| `examples/temperature-measurement-app` | | UNMAINTAINED |
140+
| `examples/terms-and-conditions-app` | James Swan | |
140141
| `examples/thermostat` | | UNMAINTAINED |
141142
| `examples/thread-br-app` | | UNMAINTAINED |
142143
| `examples/tv-app` | Chris DeCenzo, Lazar Kovacic | |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
/*
2+
*
3+
* Copyright (c) 2024 Project CHIP Authors
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
#include <app/clusters/software-diagnostics-server/SoftwareDiagnosticsTestEventTriggerHandler.h>
19+
#include <app/clusters/software-diagnostics-server/software-diagnostics-server.h>
20+
#include <platform/CHIPDeviceLayer.h>
21+
#include <platform/DiagnosticDataProvider.h>
22+
23+
using namespace chip;
24+
using namespace chip::app;
25+
using namespace chip::DeviceLayer;
26+
27+
namespace {
28+
29+
void SetTestEventTrigger_SoftwareFaultOccurred()
30+
{
31+
Clusters::SoftwareDiagnostics::Events::SoftwareFault::Type softwareFault;
32+
char threadName[kMaxThreadNameLength + 1];
33+
34+
softwareFault.id = static_cast<uint64_t>(getpid());
35+
Platform::CopyString(threadName, std::to_string(softwareFault.id).c_str());
36+
37+
softwareFault.name.SetValue(CharSpan::fromCharString(threadName));
38+
39+
std::time_t result = std::time(nullptr);
40+
// Using size of 50 as it is double the expected 25 characters "Www Mmm dd hh:mm:ss yyyy\n".
41+
char timeChar[50];
42+
if (std::strftime(timeChar, sizeof(timeChar), "%c", std::localtime(&result)))
43+
{
44+
softwareFault.faultRecording.SetValue(ByteSpan(Uint8::from_const_char(timeChar), strlen(timeChar)));
45+
}
46+
47+
Clusters::SoftwareDiagnosticsServer::Instance().OnSoftwareFaultDetect(softwareFault);
48+
}
49+
50+
} // namespace
51+
52+
bool HandleSoftwareDiagnosticsTestEventTrigger(uint64_t eventTrigger)
53+
{
54+
SoftwareDiagnosticsTrigger trigger = static_cast<SoftwareDiagnosticsTrigger>(eventTrigger);
55+
56+
switch (trigger)
57+
{
58+
case SoftwareDiagnosticsTrigger::kSoftwareFault:
59+
ChipLogProgress(Support, "[Software-Diagnostics-Test-Event] => Software Fault occurred");
60+
SetTestEventTrigger_SoftwareFaultOccurred();
61+
break;
62+
default:
63+
64+
return false;
65+
}
66+
67+
return true;
68+
}

examples/all-clusters-app/esp32/main/main.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,10 @@ extern "C" void app_main()
210210
{
211211
ESP_LOGE(TAG, "GetAppTask().StartAppTask() failed : %" CHIP_ERROR_FORMAT, error.Format());
212212
}
213-
ESPOpenThreadInit();
214213

215214
chip::DeviceLayer::PlatformMgr().ScheduleWork(InitServer, reinterpret_cast<intptr_t>(nullptr));
215+
216+
ESPOpenThreadInit();
216217
}
217218

218219
bool lowPowerClusterSleep()

examples/all-clusters-app/linux/BUILD.gn

+1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ source_set("chip-all-clusters-common") {
5656
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/rvc-modes.cpp",
5757
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/rvc-operational-state-delegate-impl.cpp",
5858
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/smco-stub.cpp",
59+
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/software-diagnostics-stub.cpp",
5960
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp",
6061
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-temperature-levels.cpp",
6162
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/tcc-mode.cpp",

0 commit comments

Comments
 (0)