From e91c601c22f7d59a1a7edf8e6ba7bc574480937c Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Sun, 15 Mar 2026 07:45:26 +0000 Subject: [PATCH 1/3] chore: workspace restructure and 3-file CI migration Phase 1: workspace restructure - Convert flat crate to workspace with members = ["crates/lambda_sqs"] - Move src/ and release-hook.sh into crates/lambda_sqs/ - Add crate Cargo.toml using workspace inheritance - Add workspace release.toml (shared settings, no PRLOG replacements) - Add crate release.toml (tag-name lambda_sqs-v{{version}}, fixed version regex, no PRLOG replacements) - Fix release-hook.sh: add --name, --package, --repository-dir args - Add bootstrap crates/lambda_sqs/CHANGELOG.md Phase 2: 3-file CI migration to toolkit 4.11.0 - config.yml: remove setup/pipeline-flags/old-workflows; add rolling jobs, dual security pattern, code_coverage with package - update_prlog.yml: new file with toolkit/label - release.yml: new file with toolkit/release_prlog after release-lambda_sqs Co-Authored-By: Claude Sonnet 4.6 Signed-off-by: Jeremiah Russell --- .circleci/config.yml | 150 ++++------------- .circleci/release.yml | 60 +++++++ .circleci/update_prlog.yml | 30 ++++ Cargo.toml | 37 +---- crates/lambda_sqs/CHANGELOG.md | 5 + crates/lambda_sqs/Cargo.toml | 38 +++++ crates/lambda_sqs/LICENSE-APACHE | 201 +++++++++++++++++++++++ crates/lambda_sqs/LICENSE-MIT | 19 +++ crates/lambda_sqs/README.md | 82 +++++++++ crates/lambda_sqs/release-hook.sh | 8 + crates/lambda_sqs/release.toml | 11 ++ {src => crates/lambda_sqs/src}/domain.rs | 0 {src => crates/lambda_sqs/src}/lib.rs | 0 release-hook.sh | 4 - release.toml | 13 +- 15 files changed, 501 insertions(+), 157 deletions(-) create mode 100644 .circleci/release.yml create mode 100644 .circleci/update_prlog.yml create mode 100644 crates/lambda_sqs/CHANGELOG.md create mode 100644 crates/lambda_sqs/Cargo.toml create mode 100644 crates/lambda_sqs/LICENSE-APACHE create mode 100644 crates/lambda_sqs/LICENSE-MIT create mode 100644 crates/lambda_sqs/README.md create mode 100755 crates/lambda_sqs/release-hook.sh create mode 100644 crates/lambda_sqs/release.toml rename {src => crates/lambda_sqs/src}/domain.rs (100%) rename {src => crates/lambda_sqs/src}/lib.rs (100%) delete mode 100755 release-hook.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index e8ae0a8..fb2a285 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,52 +4,13 @@ parameters: min_rust_version: type: string default: "1.82" - fingerprint: - type: string - default: SHA256:OkxsH8Z6Iim6WDJBaII9eTT9aaO1f3eDc6IpsgYYPVg - validation_flag: - type: boolean - default: false - description: "If true, the validation pipeline will be executed." - success_flag: - type: boolean - default: false - description: "If true, the success pipeline will be executed." - release_flag: - type: boolean - default: false - description: "If true, the success pipeline will be executed." orbs: - toolkit: jerus-org/circleci-toolkit@4.4.3 - -# Custom executors removed - using toolkit rolling executors instead + toolkit: jerus-org/circleci-toolkit@4.11.0 workflows: - check_last_commit: - when: - and: - - not: - equal: [scheduled_pipeline, << pipeline.trigger_source >>] - - not: << pipeline.parameters.success_flag >> - - not: << pipeline.parameters.validation_flag >> - - not: << pipeline.parameters.release_flag >> - - jobs: - - toolkit/choose_pipeline: - name: choose pipeline based on committer - context: bot-check - validation: - when: - and: - - not: - equal: [scheduled_pipeline, << pipeline.trigger_source >>] - - not: << pipeline.parameters.success_flag >> - - << pipeline.parameters.validation_flag >> - - not: << pipeline.parameters.release_flag >> jobs: - # Signature verification for trusted PRs (with write access for comments) - toolkit/verify_commit_signatures: name: verify_commit_signatures_trusted context: bot-check @@ -60,99 +21,56 @@ workflows: ignore: - main - /pull\/[0-9]+/ - # Signature verification for forked PRs (read-only, no comments) - toolkit/verify_commit_signatures: name: verify_commit_signatures_forked post_comment: false update_pcu: false - filters: - branches: - only: /pull\/[0-9]+/ - - toolkit/label: - min_rust_version: << pipeline.parameters.min_rust_version >> - context: pcu-app filters: branches: only: - - main - - toolkit/code_coverage: - min_rust_version: << pipeline.parameters.min_rust_version >> - - toolkit/required_builds: - min_rust_version: << pipeline.parameters.min_rust_version >> - - toolkit/test_doc_build: + - /pull\/[0-9]+/ + - toolkit/required_builds_rolling: min_rust_version: << pipeline.parameters.min_rust_version >> - toolkit/optional_builds: min_rust_version: << pipeline.parameters.min_rust_version >> - - toolkit/common_tests: + filters: + branches: + ignore: main + - toolkit/test_doc_build: min_rust_version: << pipeline.parameters.min_rust_version >> + filters: + branches: + ignore: main - toolkit/idiomatic_rust: min_rust_version: << pipeline.parameters.min_rust_version >> - - toolkit/update_prlog: + filters: + branches: + ignore: main + - toolkit/common_tests_rolling: + min_rust_version: << pipeline.parameters.min_rust_version >> + - toolkit/security: + name: security audit only + sonarcloud: false + filters: + branches: + only: + - main + - /pull\/[0-9]+/ + - toolkit/security: + name: security with sonarcloud + context: SonarCloud filters: branches: ignore: - /pull\/[0-9]+/ - main - requires: - - verify_commit_signatures_trusted - - toolkit/required_builds - - toolkit/common_tests - - toolkit/idiomatic_rust - - toolkit/code_coverage - context: - - release - - bot-check - ssh_fingerprint: << pipeline.parameters.fingerprint >> - min_rust_version: << pipeline.parameters.min_rust_version >> - - on_success: - when: - and: - - not: - equal: [scheduled_pipeline, << pipeline.trigger_source >>] - - << pipeline.parameters.success_flag >> - - not: << pipeline.parameters.validation_flag >> - - not: << pipeline.parameters.release_flag >> - - jobs: - - toolkit/end_success - - release: - when: - or: - - and: - - equal: [scheduled_pipeline, << pipeline.trigger_source >>] - - equal: ["release check", << pipeline.schedule.name >>] - - and: - - not: << pipeline.parameters.success_flag >> - - not: << pipeline.parameters.validation_flag >> - - << pipeline.parameters.release_flag >> - jobs: - - toolkit/save_next_version: - min_rust_version: << pipeline.parameters.min_rust_version >> - - - toolkit/make_release: - context: - - release - - bot-check - requires: - - toolkit/save_next_version - pre-steps: - - attach_workspace: - at: /tmp/workspace - - run: - name: Set SEMVER based on next-version file - command: | - set +ex - export SEMVER=$(cat /tmp/workspace/next-version) - echo $SEMVER - echo "export SEMVER=$SEMVER" >> "$BASH_ENV" - ssh_fingerprint: << pipeline.parameters.fingerprint >> - min_rust_version: << pipeline.parameters.min_rust_version >> - when_use_workspace: false - - - toolkit/no_release: + - toolkit/code_coverage: min_rust_version: << pipeline.parameters.min_rust_version >> + package: lambda_sqs + filters: + branches: + ignore: + - /pull\/[0-9]+/ + - main requires: - - toolkit/save_next_version: - - failed + - security with sonarcloud diff --git a/.circleci/release.yml b/.circleci/release.yml new file mode 100644 index 0000000..82f4bc1 --- /dev/null +++ b/.circleci/release.yml @@ -0,0 +1,60 @@ +version: 2.1 + +parameters: + lambda_sqs_version: + type: string + default: "" + description: "Override lambda_sqs crate version (empty = nextsv auto-detect)" + workspace_version: + type: string + default: "" + description: "Override workspace v* version (empty = nextsv auto-detect)" + +orbs: + toolkit: jerus-org/circleci-toolkit@4.11.0 + +jobs: + tools: + executor: toolkit/rust_env_rolling + steps: + - run: + name: Verify tools + command: | + set -ex + nextsv --version + pcu --version + cargo release --version + jq --version + +workflows: + release: + jobs: + - tools + + - toolkit/calculate_versions: + name: calculate-versions + requires: [tools] + crates: "lambda_sqs:lambda_sqs-v" + crate_version_overrides: "lambda_sqs:<< pipeline.parameters.lambda_sqs_version >>" + workspace_version_override: << pipeline.parameters.workspace_version >> + + - approve-release: + type: approval + requires: [calculate-versions] + + - toolkit/release_crate: + name: release-lambda_sqs + requires: [approve-release] + package: lambda_sqs + crate_tag_prefix: lambda_sqs-v + context: + - release + - bot-check + - pcu-app + + - toolkit/release_prlog: + requires: [release-lambda_sqs] + context: + - release + - bot-check + - pcu-app diff --git a/.circleci/update_prlog.yml b/.circleci/update_prlog.yml new file mode 100644 index 0000000..4b23f0e --- /dev/null +++ b/.circleci/update_prlog.yml @@ -0,0 +1,30 @@ +version: 2.1 + +parameters: + update_pcu: + type: boolean + default: false + description: "If true, pcu is updated from its main github branch before running." + +orbs: + toolkit: jerus-org/circleci-toolkit@4.11.0 + +workflows: + update_prlog: + jobs: + - toolkit/update_prlog: + name: update-prlog-on-main + context: + - release + - bot-check + - pcu-app + min_rust_version: "1.82" + target_branch: "main" + pcu_from_merge: --from-merge + update_pcu: << pipeline.parameters.update_pcu >> + pcu_verbosity: "-vvv" + - toolkit/label: + min_rust_version: "1.82" + context: pcu-app + requires: + - update-prlog-on-main diff --git a/Cargo.toml b/Cargo.toml index c3615b8..11edff7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,38 +1,17 @@ -[package] -name = "lambda_sqs" +[workspace] +members = ["crates/lambda_sqs"] +resolver = "2" + +[workspace.package] version = "0.3.1" -description = """ -Handles an SQS event and provides a vec of your type for processing. -""" -edition = "2021" authors = ["Jeremiah Russell "] license = "MIT OR Apache-2.0" -rust-version = "1.81" repository = "https://github.com/jerus-org/lambda_sqs" -readme = "README.md" -documentation = "https://docs.rs/lambda-sqs" -categories = ["web-programming"] -keywords = ["aws", "sqs", "lambda"] -exclude = [ - ".circleci/config.yml", - ".fossa.yml", - ".github/workflows/fossa.yml", - ".github/workflows/rust_security_audit.yml", - ".gitignore", - ".vscode/settings.json", - ".whitesource", - "markdownlint.jsonc", - "renovate.json", -] +edition = "2021" +rust-version = "1.82" -[dependencies] +[workspace.dependencies] serde = { version = "1.0.228", features = ["derive"] } serde_json = "1.0.149" lambda_runtime = "1.0.2" - -[dev-dependencies] tokio = "1.49.0" - -[package.metadata.docs.rs] -all-features = true -rustdoc-args = ["--cfg", "docsrs"] diff --git a/crates/lambda_sqs/CHANGELOG.md b/crates/lambda_sqs/CHANGELOG.md new file mode 100644 index 0000000..530b3d6 --- /dev/null +++ b/crates/lambda_sqs/CHANGELOG.md @@ -0,0 +1,5 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). diff --git a/crates/lambda_sqs/Cargo.toml b/crates/lambda_sqs/Cargo.toml new file mode 100644 index 0000000..bd4d91d --- /dev/null +++ b/crates/lambda_sqs/Cargo.toml @@ -0,0 +1,38 @@ +[package] +name = "lambda_sqs" +version.workspace = true +description = """ +Handles an SQS event and provides a vec of your type for processing. +""" +edition.workspace = true +authors.workspace = true +license.workspace = true +rust-version.workspace = true +repository.workspace = true +readme = "README.md" +documentation = "https://docs.rs/lambda-sqs" +categories = ["web-programming"] +keywords = ["aws", "sqs", "lambda"] +exclude = [ + ".circleci/config.yml", + ".fossa.yml", + ".github/workflows/fossa.yml", + ".github/workflows/rust_security_audit.yml", + ".gitignore", + ".vscode/settings.json", + ".whitesource", + "markdownlint.jsonc", + "renovate.json", +] + +[dependencies] +serde.workspace = true +serde_json.workspace = true +lambda_runtime.workspace = true + +[dev-dependencies] +tokio.workspace = true + +[package.metadata.docs.rs] +all-features = true +rustdoc-args = ["--cfg", "docsrs"] diff --git a/crates/lambda_sqs/LICENSE-APACHE b/crates/lambda_sqs/LICENSE-APACHE new file mode 100644 index 0000000..f49a4e1 --- /dev/null +++ b/crates/lambda_sqs/LICENSE-APACHE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/crates/lambda_sqs/LICENSE-MIT b/crates/lambda_sqs/LICENSE-MIT new file mode 100644 index 0000000..88fa50b --- /dev/null +++ b/crates/lambda_sqs/LICENSE-MIT @@ -0,0 +1,19 @@ +Copyright (c) 2015 panicbit + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/crates/lambda_sqs/README.md b/crates/lambda_sqs/README.md new file mode 100644 index 0000000..0c601a1 --- /dev/null +++ b/crates/lambda_sqs/README.md @@ -0,0 +1,82 @@ + +# Rust library lambda_sqs + +[![Crates.io][crates-badge]][crates-url] +[![MIT licensed][mit-badge]][mit-url] +[![Build Status][circleci-badge]][circleci-url] +[![Rust][version-badge]][version-url] +[![FOSSA Status][fossa-badge]][fossa-url] +[![Docs][docs-badge]][docs-url] +[![BuyMeaCoffee][bmac-badge]][bmac-url] +[![GitHubSponsors][ghub-badge]][ghub-url] + +Specialised lambda_runtime to accept and process events from SQS. + +## SQS Events + +SQS dispatches events to a lambda function in batches (often, it seems +to my surprise). This crate provides a lambda_runtime implementation that +expects to receive a batch of messages in the[SqsEvent] type and provides +a method to transform the batch of events to a vec of your Struct. + +# Usage + +To use the crate add the dependency in Cargo.toml. + +```toml +[dependencies] +lambda_sqs = "0.3.1" +``` + +## Example + +```rust +use your_module::YourStruct; +use lambda_sqs::{handler_fn, Context, Error}; +use lambda_sqs::SqsEvent; +#[tokio::main] +async fn main() -> Result<(), Error> { + lambda_sqs::run(handler_fn(my_handler)).await?; + Ok(()) +} +pub async fn my_handler(e: SqsEvent, c: Context) -> Result<(), Error> { + let events: Vec = e.into_t(); +# // Process events +# Ok(()) + } +``` + +## License + +Licensed under either of + +* Apache License, Version 2.0 + ([LICENSE-APACHE](LICENSE-APACHE) or [apache-url]) +* MIT license + ([LICENSE-MIT](LICENSE-MIT) or [mit-url]) + +at your option. + +## Contribution + +Unless you explicitly state otherwise, any contribution intentionally submitted +for inclusion in the work by you, as defined in the Apache-2.0 license, shall be +dual licensed as above, without any additional terms or conditions. + +[apache-url]: http://www.apache.org/licenses/LICENSE-2.0 +[crates-badge]: https://img.shields.io/crates/v/lambda_sqs.svg +[crates-url]: https://crates.io/crates/lambda_sqs +[mit-badge]: https://img.shields.io/badge/license-MIT-blue.svg +[mit-url]: https://github.com/jerusdp/lambda_sqs/blob/main/LICENSE +[circleci-badge]: https://dl.circleci.com/status-badge/img/gh/jerus-org/lambda_sqs/tree/main.svg?style=svg +[circleci-url]: https://dl.circleci.com/status-badge/redirect/gh/jerus-org/lambda_sqs/tree/main +[version-badge]: https://img.shields.io/badge/rust-1.81+-orange.svg +[version-url]: https://www.rust-lang.org +[fossa-badge]: https://app.fossa.com/api/projects/custom%2B22707%2Fgit%40github.com%3Ajerusdp%2Flambda_sqs.git.svg?type=shield +[fossa-url]: https://app.fossa.com/projects/custom%2B22707%2Fgit%40github.com%3Ajerusdp%2Flambda_sqs.git?ref=badge_shield +[docs-badge]: https://docs.rs/lambda_sqs/badge.svg +[docs-url]: https://docs.rs/lambda_sqs +[bmac-badge]: https://badgen.net/badge/icon/buymeacoffee?color=yellow&icon=buymeacoffee&label +[bmac-url]: https://buymeacoffee.com/jerusdp +[ghub-badge]: https://img.shields.io/badge/sponsor-30363D?logo=GitHub-Sponsors&logoColor=#white +[ghub-url]: https://github.com/sponsors/jerusdp diff --git a/crates/lambda_sqs/release-hook.sh b/crates/lambda_sqs/release-hook.sh new file mode 100755 index 0000000..54a38c1 --- /dev/null +++ b/crates/lambda_sqs/release-hook.sh @@ -0,0 +1,8 @@ +#!/bin/bash +set -exo pipefail +gen-changelog generate \ + --display-summaries \ + --name "CHANGELOG.md" \ + --package "lambda_sqs" \ + --repository-dir "../.." \ + --next-version "${NEW_VERSION:-${1}}" diff --git a/crates/lambda_sqs/release.toml b/crates/lambda_sqs/release.toml new file mode 100644 index 0000000..abca68f --- /dev/null +++ b/crates/lambda_sqs/release.toml @@ -0,0 +1,11 @@ +pre-release-commit-message = "chore: Release lambda_sqs v{{version}}" +tag-message = "{{tag_name}}" +tag-name = "lambda_sqs-v{{version}}" +sign-tag = true +sign-commit = true +consolidate-commits = true +allow-branch = ["main"] +pre-release-hook = ["./release-hook.sh"] +pre-release-replacements = [ + { file = "README.md", search = "lambda_sqs = \"[0-9]+\\.[0-9]+\\.[0-9]+\"", replace = "lambda_sqs = \"{{version}}\"", exactly = 1 }, +] diff --git a/src/domain.rs b/crates/lambda_sqs/src/domain.rs similarity index 100% rename from src/domain.rs rename to crates/lambda_sqs/src/domain.rs diff --git a/src/lib.rs b/crates/lambda_sqs/src/lib.rs similarity index 100% rename from src/lib.rs rename to crates/lambda_sqs/src/lib.rs diff --git a/release-hook.sh b/release-hook.sh deleted file mode 100755 index b583b7b..0000000 --- a/release-hook.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -# Build Changelog -gen-changelog generate --display-summaries --next-version "$SEMVER" \ No newline at end of file diff --git a/release.toml b/release.toml index 581018e..68dc787 100644 --- a/release.toml +++ b/release.toml @@ -1,8 +1,5 @@ - -pre-release-replacements = [ - { file = "README.md", search = "lambda_sqs = .*", replace = "{{crate_name}} = \" {{version}}\"" }, - { file = "src/lib.rs", search = "lambda_sqs = .*", replace = "{{crate_name}} = \" {{{version}}\"" }, - { file = "PRLOG.md", search = "## \\[Unreleased\\]", replace = "## [{{version}}] - {{date}}", exactly = 1 }, - { file = "PRLOG.md", search = "\\[Unreleased\\]:", replace = "[{{version}}]:", exactly = 1 }, - { file = "PRLOG.md", search = "\\.\\.\\.HEAD", replace = "...{{tag_name}}", exactly = 1 }, -] +sign-tag = true +sign-commit = true +consolidate-commits = true +allow-branch = ["main"] +pre-release-replacements = [] From fd85c7a6ea22827a412ad65894404ac047c9b9b3 Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Sun, 15 Mar 2026 07:51:16 +0000 Subject: [PATCH 2/3] chore: add sonar-project.properties Required for toolkit/security sonarcloud job. Co-Authored-By: Claude Sonnet 4.6 Signed-off-by: Jeremiah Russell --- sonar-project.properties | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sonar-project.properties diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 0000000..3ad3520 --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,2 @@ +sonar.projectKey=jerus-org_lambda_sqs +sonar.organization=jerus-org From eb0e80cd075ddb6a628f4f35e1365cb53f60a32c Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Sun, 15 Mar 2026 08:47:57 +0000 Subject: [PATCH 3/3] chore: use include instead of exclude in crate Cargo.toml Co-Authored-By: Claude Sonnet 4.6 Signed-off-by: Jeremiah Russell --- crates/lambda_sqs/Cargo.toml | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/crates/lambda_sqs/Cargo.toml b/crates/lambda_sqs/Cargo.toml index bd4d91d..b80c4f8 100644 --- a/crates/lambda_sqs/Cargo.toml +++ b/crates/lambda_sqs/Cargo.toml @@ -13,16 +13,13 @@ readme = "README.md" documentation = "https://docs.rs/lambda-sqs" categories = ["web-programming"] keywords = ["aws", "sqs", "lambda"] -exclude = [ - ".circleci/config.yml", - ".fossa.yml", - ".github/workflows/fossa.yml", - ".github/workflows/rust_security_audit.yml", - ".gitignore", - ".vscode/settings.json", - ".whitesource", - "markdownlint.jsonc", - "renovate.json", +include = [ + "**/*.rs", + "Cargo.toml", + "README.md", + "LICENSE-MIT", + "LICENSE-APACHE", + "CHANGELOG.md", ] [dependencies]