Skip to content

Commit

Permalink
Merge branch 'main' into LienNguyen2910-patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
Skptak committed Oct 19, 2023
2 parents cf5b349 + e2833bb commit 223f000
Show file tree
Hide file tree
Showing 310 changed files with 2,074 additions and 1,946 deletions.
46 changes: 46 additions & 0 deletions .github/.cSpellWords.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
CBMC
CBOR
CMOCK
CMock
Cmock
Coverity
DCMOCK
DNDEBUG
DUNITY
FOOB
FOOBA
FOOBDA
MISRA
MQTT
Misra
OPTIMISED
Wunused
cbmc
cbor
cborvalue
cmock
coverity
ctest
deinitializing
isystem
lcov
lpthread
misra
mqdes
mqttstatus
mqueue
osstatus
otahttppage
otahttpsectionoverview
otamqttpage
otamqttsectionoverview
otaosfipage
otaosfisectionoverview
otapalpage
otapalsectionoverview
pbuffer
pclienttoken
sinclude
stringz
tinycbor
utest
2 changes: 2 additions & 0 deletions .github/.exclude-urls.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
https://dummy-url.com/ota.bin

106 changes: 70 additions & 36 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Clone This Repo
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Check warnings
run: |
git submodule update --init --recursive --checkout --depth 1
Expand All @@ -26,19 +26,20 @@ jobs:
complexity:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup
run: sudo apt-get install complexity
- name: Complexity
uses: FreeRTOS/CI-CD-Github-Actions/complexity@main
with:
path: ./
horrid_threshold: 14

unittest:
runs-on: ubuntu-latest
steps:
- name: Clone This Repo
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Build
run: |
git submodule update --init --recursive --checkout --depth 1
Expand All @@ -54,28 +55,31 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Clone This Repo
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Generate Build Files
run: |
git submodule update --init --recursive --checkout --depth 1
sudo apt-get install -y lcov
cmake -S test -B build \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_C_FLAGS='--coverage -Wall -Wextra -DNDEBUG'
- name: Run Coverage
run: |
cmake --build build/ --target coverage
- name: Check Coverage
uses: FreeRTOS/CI-CD-Github-Actions/coverage-cop@main
with:
path: ./build/coverage.info
coverage-file: ./build/coverage.info
line-coverage-min: 100
branch-coverage-min: 100

doxygen:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Run doxygen build
uses: FreeRTOS/CI-CD-Github-Actions/doxygen@main
with:
Expand All @@ -84,47 +88,31 @@ jobs:
spell-check:
runs-on: ubuntu-latest
steps:
- name: Checkout Parent Repo
uses: actions/checkout@v2
with:
ref: main
repository: aws/aws-iot-device-sdk-embedded-C
- name: Clone This Repo
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Run spellings check
uses: FreeRTOS/CI-CD-Github-Actions/spellings@main
with:
path: tmp
- name: Install spell
run: |
sudo apt-get install spell
sudo apt-get install util-linux
- name: Check spelling
run: |
PATH=$PATH:$PWD/tools/spell
find-unknown-comment-words --directory tmp/ --lexicon tmp/tools/lexicon.txt
if [ $? -ne "0" ]; then
exit 1
fi
path: ./

formatting:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Check formatting
uses: FreeRTOS/CI-CD-Github-Actions/formatting@main
with:
path: ./
exclude-dirs: |
docs
.github
exclude-dirs: docs,.github

git-secrets:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Checkout awslabs/git-secrets
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: awslabs/git-secrets
ref: master
Expand All @@ -139,15 +127,61 @@ jobs:
memory_statistics:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Clone submodules
run: git submodule update --init --recursive --checkout --depth 1
- name: Install Python3
uses: actions/setup-python@v2
uses: actions/setup-python@v3
with:
python-version: '3.7.10'
python-version: "3.11.0"
- name: Measure sizes
uses: FreeRTOS/CI-CD-Github-Actions/memory_statistics@main
with:
config: .github/memory_statistics_config.json
check_against: docs/doxygen/include/size_table.md
config: .github/memory_statistics_config.json
check_against: docs/doxygen/include/size_table.md

link-verifier:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Check Links
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: FreeRTOS/CI-CD-Github-Actions/link-verifier@main
with:
path: ./
allowlist-file: .github/.exclude-urls.txt

verify-manifest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0

# At time of writing the gitmodules are set not to pull
# Even when using fetch submodules. Need to run this command
# To force it to grab them.
- name: Perform Recursive Clone
shell: bash
run: git submodule update --checkout --init --recursive

- name: Run manifest verifier
uses: FreeRTOS/CI-CD-GitHub-Actions/manifest-verifier@main
with:
path: ./
fail-on-incorrect-version: true

proof_ci:
if: ${{ github.event.pull_request }}
runs-on: cbmc_ubuntu-latest_16-core
steps:
- name: Set up CBMC runner
uses: FreeRTOS/CI-CD-Github-Actions/set_up_cbmc_runner@main
- run: |
git submodule update --init --checkout --recursive --depth 1
- name: Run CBMC
uses: FreeRTOS/CI-CD-Github-Actions/run_cbmc@main
with:
proofs_dir: test/cbmc/proofs
23 changes: 23 additions & 0 deletions .github/workflows/formatting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Format Pull Request Files

on:
issue_comment:
types: [created]

env:
bashPass: \033[32;1mPASSED -
bashInfo: \033[33;1mINFO -
bashFail: \033[31;1mFAILED -
bashEnd: \033[0m

jobs:
Formatting:
name: Run Formatting Check
if: ${{ github.event.issue.pull_request &&
( ( github.event.comment.body == '/bot run uncrustify' ) ||
( github.event.comment.body == '/bot run formatting' ) ) }}
runs-on: ubuntu-20.04
steps:
- name: Apply Formatting Fix
uses: FreeRTOS/CI-CD-Github-Actions/formatting-bot@main
id: check-formatting
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ on:
required: true

jobs:
generate-sbom-and-tag-commit:
tag-commit:
name: Tag commit
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.commit_id }}
- name: Configure git identity
Expand Down Expand Up @@ -53,7 +53,7 @@ jobs:
- name: Install ZIP tools
run: sudo apt-get install zip unzip
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.commit_id }}
path: ota-for-aws-iot-embedded-sdk
Expand Down
28 changes: 23 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,34 @@
# Changelog for AWS IoT Over-the-air Update Library

### v3.4.0 (October 2022)
- [#450](https://github.com/aws/ota-for-aws-iot-embedded-sdk/pull/450) Remove assertion check to make out-of-order packet work
- [#449](https://github.com/aws/ota-for-aws-iot-embedded-sdk/pull/449) MISRA C:2012 compliance updates
- [#443](https://github.com/aws/ota-for-aws-iot-embedded-sdk/pull/443) Removal of const for pData
- [#441](https://github.com/aws/ota-for-aws-iot-embedded-sdk/pull/441) Add user callable agent cycler
- [#440](https://github.com/aws/ota-for-aws-iot-embedded-sdk/pull/440) Keep event/callback functions to avoid access NULL
- [#439](https://github.com/aws/ota-for-aws-iot-embedded-sdk/pull/439) Self timer restart bug fix
- [#436](https://github.com/aws/ota-for-aws-iot-embedded-sdk/pull/436) Update OtaPalWriteBlock_t comment with a note about returning from the function and exception condition.
- [#433](https://github.com/aws/ota-for-aws-iot-embedded-sdk/pull/433) Replace mq_send/mq_receive with mq_timedsend/mq_timedreceive.
- [#432](https://github.com/aws/ota-for-aws-iot-embedded-sdk/pull/432) Change default signature size to 384 to support RSA-3072
- [#436](https://github.com/aws/ota-for-aws-iot-embedded-sdk/pull/432) Fix the length judgement in custom job, and move OtaAppCallback to make sure job ID is valid.
- [#428](https://github.com/aws/ota-for-aws-iot-embedded-sdk/pull/428) Ignore duplicate packet and wait for valid file blocks
- [#427](https://github.com/aws/ota-for-aws-iot-embedded-sdk/pull/427) Add new event for application callback when no active jobs are available
- [#426](https://github.com/aws/ota-for-aws-iot-embedded-sdk/pull/426) Send status update on first block received
- [#419](https://github.com/aws/ota-for-aws-iot-embedded-sdk/pull/419) Move cleanup of job id to after OtaAppCallback
- [#413](https://github.com/aws/ota-for-aws-iot-embedded-sdk/pull/413) Clear timers in shutdown and suspend

### v3.3.0 (December 2021)
- Added CBMC proofs of all public and private functions in the OTA library.
- Added CBMC proofs of all public and private functions in the OTA library.
- [#373](https://github.com/aws/ota-for-aws-iot-embedded-sdk/pull/373) Updated compiler flag for tinycbor source files
- [#407](https://github.com/aws/ota-for-aws-iot-embedded-sdk/pull/407) Added checks to prevent arithmetic overflows
- [#390](https://github.com/aws/ota-for-aws-iot-embedded-sdk/pull/390) Make OTA file type configurable.
- [#329](https://github.com/aws/ota-for-aws-iot-embedded-sdk/pull/329) Misc fixes to remove build warnings
- [#329](https://github.com/aws/ota-for-aws-iot-embedded-sdk/pull/329) Misc fixes to remove build warnings
- [#356](https://github.com/aws/ota-for-aws-iot-embedded-sdk/pull/356) Add type cast to event functions as per POSIX spec

### v3.2.0 (November 2021)
- [#275](https://github.com/aws/ota-for-aws-iot-embedded-sdk/pull/276) Updated the doxygen version from 1.8.20 to 1.9.2
- [#275](https://github.com/aws/ota-for-aws-iot-embedded-sdk/pull/276) Updated the doxygen version from 1.8.20 to 1.9.2
- [#236](https://github.com/aws/ota-for-aws-iot-embedded-sdk/pull/236) Added C++ guards
- [#231](https://github.com/aws/ota-for-aws-iot-embedded-sdk/pull/231) Added checks for http interface functions.
- [#231](https://github.com/aws/ota-for-aws-iot-embedded-sdk/pull/231) Added checks for http interface functions.

### v3.1.0 (August 2021)
- [#232](https://github.com/aws/ota-for-aws-iot-embedded-sdk/pull/232) Add updater version to the status details when job succeeds
Expand Down
6 changes: 3 additions & 3 deletions MISRA.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ _Ref 8.13.1_
- MISRA C-2012 Rule 8.13 There are multiple functions that all use the same function header so that
they can be assigned to function pointers in a seamless manner. There are a few that modify the
OtaAgentContext_t that gets passed in. In order to allow convienent assignment of these function pointers
we supress this rule on this function that can't have const added.
we suppress this rule on this function that can't have const added.

#### Rule 10.1
_Ref 10.1.1_
Expand All @@ -44,7 +44,7 @@ _Ref 10.8.1_
_Ref 11.8.1_

- Misra C-2012 Rule 11.8 will raise an error if certain variables are not marked as const, even if the variables do get
modified in that function. As such there are two occurences where to get around that error, we supress these.
modified in that function. As such there are two occurrences where to get around that error, we suppress these.

#### Rule 19.2
_Ref 19.2.1_
Expand Down Expand Up @@ -84,6 +84,6 @@ _Ref 21.3.2_
#### Rule 21.8
_Ref 21.8.1_

- MISRA C-2012 Rule 21.8 Does not allow the use of some of the functions in stdlib.h. One of the OTA platform
- MISRA C-2012 Rule 21.8 Does not allow the use of some of the functions in stdlib.h. One of the OTA platform
abstraction layer interfaces `abort` is flagged for this violation. This is implemented by a platform
abstraction layer and always called through the OTA PAL interface.
Loading

0 comments on commit 223f000

Please sign in to comment.