Skip to content

Commit 9b9e9dd

Browse files
Merge pull request #92 from Skptak/CI-CD_Updates
CI-CD Updates
2 parents 24e7d1e + 5790cca commit 9b9e9dd

Some content is hidden

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

71 files changed

+7785
-7164
lines changed

Diff for: .github/.cSpellWords.txt

+410
Large diffs are not rendered by default.

Diff for: .github/CONTRIBUTING.md

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Contributing Guidelines
2+
3+
Thank you for your interest in contributing to our project. Whether it's a bug report, new feature, correction, or additional
4+
documentation, we greatly value feedback and contributions from our community.
5+
6+
Please read through this document before submitting any issues or pull requests to ensure we have all the necessary
7+
information to effectively respond to your bug report or contribution.
8+
9+
10+
## Reporting Bugs/Feature Requests
11+
12+
We welcome you to use the GitHub issue tracker to report bugs or suggest features.
13+
14+
When filing an issue, please check [existing open](https://github.com/FreeRTOS/coreMQTT/issues), or [recently closed](https://github.com/FreeRTOS/coreMQTT/issues?q=is%3Aissue+is%3Aclosed), issues to make sure somebody else hasn't already
15+
reported the issue. Please try to include as much information as you can. Details like these are incredibly useful:
16+
17+
* A reproducible test case or series of steps
18+
* The version of our code being used
19+
* Any modifications you've made relevant to the bug
20+
* Anything unusual about your environment or deployment
21+
22+
23+
## Contributing via Pull Requests
24+
Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that:
25+
26+
1. You are working against the latest source on the *main* branch.
27+
1. You check existing open, and recently merged, pull requests to make sure someone else hasn't addressed the problem already.
28+
1. You open an issue to discuss any significant work - we would hate for your time to be wasted.
29+
30+
To send us a pull request, please:
31+
32+
1. Fork the repository.
33+
1. Modify the source; please focus on the specific change you are contributing. If you also reformat all the code, it will be hard for us to focus on your change.
34+
1. Ensure that your contributions conform to the [style guide](https://www.freertos.org/FreeRTOS-Coding-Standard-and-Style-Guide.html).
35+
1. Format your code with uncrustify, using the config available in [FreeRTOS/CI-CD-Github-Actions](https://github.com/FreeRTOS/CI-CD-Github-Actions/blob/main/formatting/uncrustify.cfg).
36+
1. Ensure local tests pass.
37+
1. Commit to your fork using clear commit messages.
38+
1. Send us a pull request, answering any default questions in the pull request interface.
39+
1. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.
40+
41+
GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and
42+
[creating a pull request](https://help.github.com/articles/creating-a-pull-request/).
43+
44+
45+
## Finding contributions to work on
46+
Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels ((enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any ['help wanted'](https://github.com/FreeRTOS/coreMQTT/labels?q=help+wanted) issues is a great place to start.
47+
48+
49+
## Code of Conduct
50+
This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
51+
For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
52+
[email protected] with any additional questions or comments.
53+
54+
55+
## Security issue notifications
56+
If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](https://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public github issue.
57+
58+
59+
## Licensing
60+
61+
See the [LICENSE](../LICENSE) file for our project's licensing. We will ask you to confirm the licensing of your contribution.
62+
63+
We may ask you to sign a [Contributor License Agreement (CLA)](https://en.wikipedia.org/wiki/Contributor_License_Agreement) for larger changes.

Diff for: .github/workflows/ci.yml

+34-26
Original file line numberDiff line numberDiff line change
@@ -16,43 +16,51 @@ on:
1616
workflow_dispatch:
1717

1818
jobs:
19+
formatting:
20+
runs-on: ubuntu-20.04
21+
steps:
22+
- uses: actions/checkout@v3
23+
- name: Check Formatting of Files
24+
uses: FreeRTOS/CI-CD-Github-Actions/formatting@main
25+
with:
26+
exclude-dirs: Drivers
27+
1928
spell-check:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Clone This Repo
32+
uses: actions/checkout@v3
33+
- name: Run spellings check
34+
uses: FreeRTOS/CI-CD-Github-Actions/spellings@main
35+
36+
link-verifier:
2037
runs-on: ubuntu-latest
2138
steps:
2239
- name: Clone This Repo
23-
uses: actions/checkout@v2
24-
- name: Run spellings check
25-
uses: FreeRTOS/CI-CD-Github-Actions/spellings@main
26-
with:
27-
path: ./
40+
uses: actions/checkout@v3
41+
- name: Link Verification
42+
uses: FreeRTOS/CI-CD-Github-Actions/link-verifier@main
2843

29-
formatting:
44+
verify-manifest:
3045
runs-on: ubuntu-latest
3146
steps:
32-
- uses: actions/checkout@v2
33-
- name: Install Uncrustify
34-
run: sudo apt-get install uncrustify
35-
- name: Run Uncrustify
36-
run: |
37-
uncrustify --version
38-
find Projects Common -iname "*.[hc]" -exec uncrustify --check -c tools/uncrustify.cfg {} +
39-
- name: Check For Trailing Whitespace
40-
run: |
41-
set +e
42-
grep --exclude="README.md" -rnI -e "[[:blank:]]$" .
43-
if [ "$?" = "0" ]; then
44-
echo "Files have trailing whitespace."
45-
exit 1
46-
else
47-
exit 0
48-
fi
47+
- uses: actions/checkout@v3
48+
with:
49+
submodules: true
50+
fetch-depth: 0
51+
52+
- name: Run manifest verifier
53+
uses: FreeRTOS/CI-CD-GitHub-Actions/manifest-verifier@main
54+
with:
55+
path: ./
56+
fail-on-incorrect-version: true
4957

5058
git-secrets:
5159
runs-on: ubuntu-latest
5260
steps:
53-
- uses: actions/checkout@v2
61+
- uses: actions/checkout@v3
5462
- name: Checkout awslabs/git-secrets
55-
uses: actions/checkout@v2
63+
uses: actions/checkout@v3
5664
with:
5765
repository: awslabs/git-secrets
5866
ref: master
@@ -67,7 +75,7 @@ jobs:
6775
pre-commit-hooks:
6876
runs-on: ubuntu-latest
6977
steps:
70-
- uses: actions/checkout@v2
78+
- uses: actions/checkout@v3
7179
- name: Fetch HEAD revision
7280
run: git fetch origin
7381
- name: Install python pip

Diff for: .github/workflows/formatting.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Format Pull Request Files
2+
3+
on:
4+
issue_comment:
5+
types: [created]
6+
7+
env:
8+
bashPass: \033[32;1mPASSED -
9+
bashInfo: \033[33;1mINFO -
10+
bashFail: \033[31;1mFAILED -
11+
bashEnd: \033[0m
12+
13+
jobs:
14+
Formatting:
15+
name: Run Formatting Check
16+
if: ${{ github.event.issue.pull_request &&
17+
( ( github.event.comment.body == '/bot run uncrustify' ) ||
18+
( github.event.comment.body == '/bot run formatting' ) ) }}
19+
runs-on: ubuntu-20.04
20+
steps:
21+
- name: Apply Formatting Fix
22+
uses: FreeRTOS/CI-CD-Github-Actions/formatting-bot@main
23+
id: check-formatting

Diff for: Common/app/defender/defender_task.c

+13-13
Original file line numberDiff line numberDiff line change
@@ -353,19 +353,19 @@ static void prvUnsubscribeFromDefenderTopics( DefenderAgentCtx_t * pxCtx )
353353
static void prvPrintHex( const uint8_t * pcPayload,
354354
size_t xPayloadLen )
355355
{
356-
#if ( LOG_LEVEL >= LOG_DEBUG )
357-
for( uint32_t i = 0; i < xPayloadLen; i += 16 )
358-
{
359-
LogDebug( "\t%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X",
360-
pcPayload[ i + 0 ], pcPayload[ i + 1 ], pcPayload[ i + 2 ], pcPayload[ i + 3 ],
361-
pcPayload[ i + 4 ], pcPayload[ i + 5 ], pcPayload[ i + 6 ], pcPayload[ i + 7 ],
362-
pcPayload[ i + 8 ], pcPayload[ i + 9 ], pcPayload[ i + 10 ], pcPayload[ i + 11 ],
363-
pcPayload[ i + 12 ], pcPayload[ i + 13 ], pcPayload[ i + 14 ], pcPayload[ i + 15 ] );
364-
}
365-
#else /* LOG_LEVEL >= LOG_DEBUG */
366-
( void ) pcPayload;
367-
( void ) xPayloadLen;
368-
#endif /* LOG_LEVEL < LOG_DEBUG */
356+
#if ( LOG_LEVEL >= LOG_DEBUG )
357+
for( uint32_t i = 0; i < xPayloadLen; i += 16 )
358+
{
359+
LogDebug( "\t%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X",
360+
pcPayload[ i + 0 ], pcPayload[ i + 1 ], pcPayload[ i + 2 ], pcPayload[ i + 3 ],
361+
pcPayload[ i + 4 ], pcPayload[ i + 5 ], pcPayload[ i + 6 ], pcPayload[ i + 7 ],
362+
pcPayload[ i + 8 ], pcPayload[ i + 9 ], pcPayload[ i + 10 ], pcPayload[ i + 11 ],
363+
pcPayload[ i + 12 ], pcPayload[ i + 13 ], pcPayload[ i + 14 ], pcPayload[ i + 15 ] );
364+
}
365+
#else /* LOG_LEVEL >= LOG_DEBUG */
366+
( void ) pcPayload;
367+
( void ) xPayloadLen;
368+
#endif /* LOG_LEVEL < LOG_DEBUG */
369369
}
370370

371371
/*-----------------------------------------------------------*/

Diff for: Common/app/defender/metrics_collector_lwip.c

+8-8
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@
4646
#include "lwipopts.h"
4747

4848
#if !defined( LWIP_TCPIP_CORE_LOCKING ) || ( LWIP_TCPIP_CORE_LOCKING == 0 )
49-
#error "Network metrics are only supported in core locking mode. Please define LWIP_TCPIP_CORE_LOCKING to 1 in lwipopts.h."
49+
#error "Network metrics are only supported in core locking mode. Please define LWIP_TCPIP_CORE_LOCKING to 1 in lwipopts.h."
5050
#endif
5151

5252
#if MIB2_STATS == 0
53-
#error "MIB2_STATS must be enabled."
53+
#error "MIB2_STATS must be enabled."
5454
#endif
5555

5656
#if LWIP_BYTES_IN_OUT_UNSUPPORTED != 0
57-
#error "LWIP_BYTES_IN_OUT_UNSUPPORTED must be set to 0."
57+
#error "LWIP_BYTES_IN_OUT_UNSUPPORTED must be set to 0."
5858
#endif
5959

6060
#define UINT16_STR_LEN 5
@@ -122,11 +122,11 @@ CborError xGetNetworkStats( CborEncoder * pxEncoder )
122122

123123
LOCK_TCPIP_CORE();
124124

125-
#if LWIP_SINGLE_NETIF
126-
pxNetif = netif_default;
127-
#else
128-
NETIF_FOREACH( pxNetif )
129-
#endif /* LWIP_SINGLE_NETIF */
125+
#if LWIP_SINGLE_NETIF
126+
pxNetif = netif_default;
127+
#else
128+
NETIF_FOREACH( pxNetif )
129+
#endif /* LWIP_SINGLE_NETIF */
130130
{
131131
xBytesIn += pxNetif->mib2_counters.ifinoctets;
132132
xBytesOut += pxNetif->mib2_counters.ifoutoctets;

Diff for: Common/app/mqtt/mqtt_agent_task.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
#define RETRY_MAX_BACKOFF_DELAY ( 5U * 60U )
8787

8888
/**
89-
* @brief Multiplier to apply to the bacoff delay to convert arbitrary units to milliseconds.
89+
* @brief Multiplier to apply to the backoff delay to convert arbitrary units to milliseconds.
9090
*/
9191
#define RETRY_BACKOFF_MULTIPLIER ( 100U )
9292

Diff for: Common/app/mqtt/subscription_manager.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@
3939
* @brief Maximum number of concurrent subscriptions.
4040
*/
4141
#ifndef MQTT_AGENT_MAX_SUBSCRIPTIONS
42-
#define MQTT_AGENT_MAX_SUBSCRIPTIONS 10U
42+
#define MQTT_AGENT_MAX_SUBSCRIPTIONS 10U
4343
#endif /* MQTT_AGENT_MAX_SUBSCRIPTIONS */
4444

4545
/**
4646
* @brief Maximum number of callbacks that may be registered.
4747
*/
4848
#ifndef MQTT_AGENT_MAX_CALLBACKS
49-
#define MQTT_AGENT_MAX_CALLBACKS 10U
49+
#define MQTT_AGENT_MAX_CALLBACKS 10U
5050
#endif /* MQTT_AGENT_MAX_CALLBACKS */
5151

5252
/**

0 commit comments

Comments
 (0)