Create cargo.yml#221
Conversation
Signed-off-by: Dargon789 <64915515+Dargon789@users.noreply.github.com>
Reviewer's GuideAdds a CircleCI job configuration for building, formatting, and testing the Rust project using cargo with caching of dependencies and build artifacts. Flow diagram for CircleCI cargo build-and-test job stepsflowchart TD
S["Start build-and-test job"] --> A["Checkout repository"]
A --> B["Restore cache with keys: v1-cargo-{{ checksum 'Cargo.lock' }}, v1-cargo-"]
B --> C["Run: cargo fmt -- --check (first formatting check)"]
C --> D["Run: cargo test (first test run)"]
D --> E["Save cache with key: v1-cargo-{{ checksum 'Cargo.lock' }}"]
E --> F["Cache path: ~/.cargo/bin"]
F --> G["Cache path: ~/.cargo/registry/index"]
G --> H["Cache path: ~/.cargo/registry/cache"]
H --> I["Cache path: ~/.cargo/git/db"]
I --> J["Cache path: target"]
J --> K["Run: cargo fmt -- --check (second formatting check)"]
K --> L["Run: cargo test (second test run)"]
L --> T["End build-and-test job"]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Summary of ChangesHello @Dargon789, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces continuous integration for Rust projects by adding a CircleCI configuration. The primary goal is to automate the process of checking code formatting and running tests, ensuring that all new contributions adhere to established code standards and do not introduce regressions. This setup will help maintain code quality and accelerate the development feedback loop. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a new CircleCI workflow for building and testing the Rust project. The configuration correctly sets up a Rust environment, uses caching to speed up builds, and runs format checks and tests. However, there are redundant steps that run the checks and tests twice, which should be removed. I've also included a suggestion to use a more flexible Docker image tag for easier maintenance.
There was a problem hiding this comment.
Hey there - I've reviewed your changes - here's some feedback:
- The
cargo fmtandcargo teststeps are duplicated at the end of the job; consider removing the second pair or extracting them into a reusable command to avoid redundant execution. - You may want to narrow the cache paths (e.g., omit
~/.cargo/binif not needed) to avoid caching large or unnecessary files and speed up CI runs.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The `cargo fmt` and `cargo test` steps are duplicated at the end of the job; consider removing the second pair or extracting them into a reusable command to avoid redundant execution.
- You may want to narrow the cache paths (e.g., omit `~/.cargo/bin` if not needed) to avoid caching large or unnecessary files and speed up CI runs.
## Individual Comments
### Comment 1
<location> `.circleci/cargo.yml:13-18` </location>
<code_context>
+ keys:
+ - v1-cargo-{{ checksum "Cargo.lock" }}
+ - v1-cargo-
+ - run:
+ name: "Check formatting"
+ command: cargo fmt -- --check
+ - run:
+ name: "Run tests"
+ command: cargo test
+ - save_cache:
+ key: v1-cargo-{{ checksum "Cargo.lock" }}
</code_context>
<issue_to_address>
**suggestion (performance):** Avoid running `cargo fmt --check` and `cargo test` twice in the same job.
These duplicate the earlier formatting and test steps and only increase CI time. Please remove the second pair, or replace them with a different check (for example, clippy) if you meant to add another kind of validation.
Suggested implementation:
```
- run:
name: "Run clippy"
command: cargo clippy --all-targets --all-features -- -D warnings
```
From the context, it looks like there was likely a second `Run tests` step after the duplicated `Check formatting` step that isn't fully shown in the snippet. To fully implement your comment ("Avoid running `cargo fmt --check` and `cargo test` twice in the same job"):
1. If there is a second `Run tests` step later in the file (after the second formatting step), remove that duplicate `cargo test` run entirely, keeping only the first `Run tests` step earlier in the job.
2. Ensure that the only `cargo fmt -- --check` invocation is the first one (already present before `save_cache`).
3. Optionally, if clippy is not desired, you can instead remove the entire second `run` block (the one changed above) so that no extra validation is added.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
…updates (#910) * Add .circleci/config.yml * Create google.yml (#1) Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com> * Update config.yml (#3) Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com> * feat: upgrade c8 from 9.1.0 to 10.1.3 Snyk has created this PR to upgrade c8 from 9.1.0 to 10.1.3. See this package in npm: c8 See this project in Snyk: https://app.snyk.io/org/dargon789/project/68a3328a-d2b6-4975-b7db-af96a29fc4ac?utm_source=github-cloud-app&utm_medium=referral&page=upgrade-pr * feat: upgrade c8 from 9.1.0 to 10.1.3 Snyk has created this PR to upgrade c8 from 9.1.0 to 10.1.3. See this package in npm: c8 See this project in Snyk: https://app.snyk.io/org/dargon789/project/e2757016-0d48-429d-8c99-bffba0039c3a?utm_source=github-cloud-app&utm_medium=referral&page=upgrade-pr * Update google.yml (#11) Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com> * fix: packages/google-cloud-dialogflow-cx/samples/package.json to reduce vulnerabilities The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-JSYAML-13961110 * Create build-attested-image.yml (#217) * Create build-attested-image.yml CI: Introduce a build-attested-image workflow that builds and pushes a Docker image to GitHub Container Registry and generates build provenance attestations. Signed-off-by: Dargon789 <64915515+Dargon789@users.noreply.github.com> * Update .github/workflows/build-attested-image.yml Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com> Signed-off-by: Dargon789 <64915515+Dargon789@users.noreply.github.com> --------- Signed-off-by: Dargon789 <64915515+Dargon789@users.noreply.github.com> Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com> * fix: packages/google-shopping-merchant-products/samples/package.json to reduce vulnerabilities (#214) The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-JSYAML-13961110 Co-authored-by: snyk-io[bot] <141718529+snyk-io[bot]@users.noreply.github.com> * fix: packages/google-cloud-kms-inventory/samples/package.json to reduce vulnerabilities (#213) The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-JSYAML-13961110 Co-authored-by: snyk-io[bot] <141718529+snyk-io[bot]@users.noreply.github.com> * fix: packages/google-cloud-certificatemanager/samples/package.json to reduce vulnerabilities (#212) The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-JSYAML-13961110 Co-authored-by: snyk-io[bot] <141718529+snyk-io[bot]@users.noreply.github.com> * fix: packages/google-cloud-workstations/samples/package.json to reduce vulnerabilities (#211) The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-JSYAML-13961110 Co-authored-by: snyk-io[bot] <141718529+snyk-io[bot]@users.noreply.github.com> * chore(deps): bump the npm_and_yarn group across 1 directory with 2 updates Bumps the npm_and_yarn group with 2 updates in the / directory: [brace-expansion](https://github.com/juliangruber/brace-expansion) and [js-yaml](https://github.com/nodeca/js-yaml). Updates `brace-expansion` from 1.1.11 to 1.1.12 - [Release notes](https://github.com/juliangruber/brace-expansion/releases) - [Commits](juliangruber/brace-expansion@1.1.11...v1.1.12) Updates `js-yaml` from 4.1.0 to 4.1.1 - [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md) - [Commits](nodeca/js-yaml@4.1.0...4.1.1) --- updated-dependencies: - dependency-name: brace-expansion dependency-version: 1.1.12 dependency-type: indirect dependency-group: npm_and_yarn - dependency-name: js-yaml dependency-version: 4.1.1 dependency-type: indirect dependency-group: npm_and_yarn ... Signed-off-by: dependabot[bot] <support@github.com> * fix: packages/google-cloud-iap/samples/package.json to reduce vulnerabilities The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-JSYAML-13961110 * Create cargo.yml (#221) CI: Introduce a CircleCI job that runs cargo fmt and cargo test using a Rust Docker image with caching for dependencies and build artifacts. https://github.com/apps/gemini-code-assist Highlights New CircleCI Configuration: A new CircleCI configuration file, .circleci/cargo.yml, has been added to the repository. Rust Build and Test Workflow: The new configuration defines a build-and-test job specifically for Rust projects, utilizing the cimg/rust:1.88.0 Docker image. Automated Code Quality Checks: The workflow includes steps to automatically check code formatting using cargo fmt -- --check and run all tests with cargo test. Dependency Caching: Caching mechanisms for Cargo dependencies are implemented to speed up subsequent CI runs by restoring and saving ~/.cargo and target directories. Signed-off-by: Dargon789 <64915515+Dargon789@users.noreply.github.com> * Create ci-foundry.yml (#224) CI: Introduce a CircleCI 2.1 configuration file defining a custom Docker executor and a minimal workflow that checks out the repository and runs a placeholder command. Signed-off-by: Dargon789 <64915515+Dargon789@users.noreply.github.com> * fix: packages/google-cloud-dataform/samples/package.json to reduce vulnerabilities (#209) The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-JSYAML-13961110 Co-authored-by: snyk-io[bot] <141718529+snyk-io[bot]@users.noreply.github.com> * fix: packages/google-devtools-cloudbuild/samples/package.json to reduce vulnerabilities (#208) The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-JSYAML-13961110 Co-authored-by: snyk-io[bot] <141718529+snyk-io[bot]@users.noreply.github.com> * Create jekyll-gh-pages.yml (#230) CI: Introduce a GitHub Actions workflow that builds the Jekyll site and deploys it to GitHub Pages using preinstalled dependencies. Signed-off-by: Dargon789 <64915515+Dargon789@users.noreply.github.com> * Update config.yml (#232) CI: Simplify CircleCI configuration to a single Docker job that checks out the repo and echoes a greeting, orchestrated by a basic workflow. Signed-off-by: Dargon789 <64915515+Dargon789@users.noreply.github.com> * fix: packages/google-cloud-workflows-executions/samples/package.json to reduce vulnerabilities (#207) The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-JSYAML-13961110 Co-authored-by: snyk-io[bot] <141718529+snyk-io[bot]@users.noreply.github.com> * fix: packages/google-shopping-merchant-promotions/samples/package.json to reduce vulnerabilities (#206) The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-JSYAML-13961110 Co-authored-by: snyk-io[bot] <141718529+snyk-io[bot]@users.noreply.github.com> * fix: packages/google-shopping-merchant-reviews/samples/package.json to reduce vulnerabilities (#205) The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-JSYAML-13961110 Co-authored-by: snyk-io[bot] <141718529+snyk-io[bot]@users.noreply.github.com> * fix: packages/google-cloud-filestore/samples/package.json to reduce vulnerabilities (#203) The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-JSYAML-13961110 Co-authored-by: snyk-io[bot] <141718529+snyk-io[bot]@users.noreply.github.com> * fix: packages/google-shopping-merchant-datasources/samples/package.json to reduce vulnerabilities (#228) The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-MOCHA-2863123 - https://snyk.io/vuln/SNYK-JS-INFLIGHT-6095116 - https://snyk.io/vuln/SNYK-JS-SERIALIZEJAVASCRIPT-6147607 - https://snyk.io/vuln/SNYK-JS-NANOID-2332193 - https://snyk.io/vuln/SNYK-JS-JSYAML-13961110 - https://snyk.io/vuln/SNYK-JS-MINIMATCH-3050818 - https://snyk.io/vuln/SNYK-JS-NANOID-8492085 Co-authored-by: snyk-io[bot] <141718529+snyk-io[bot]@users.noreply.github.com> * fix: packages/google-cloud-asset/samples/package.json to reduce vulnerabilities (#36) The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-JSYAML-13961110 Co-authored-by: snyk-io[bot] <141718529+snyk-io[bot]@users.noreply.github.com> * fix: packages/google-cloud-apihub/samples/package.json to reduce vulnerabilities (#227) The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-MOCHA-2863123 - https://snyk.io/vuln/SNYK-JS-INFLIGHT-6095116 - https://snyk.io/vuln/SNYK-JS-SERIALIZEJAVASCRIPT-6147607 - https://snyk.io/vuln/SNYK-JS-NANOID-2332193 - https://snyk.io/vuln/SNYK-JS-JSYAML-13961110 - https://snyk.io/vuln/SNYK-JS-MINIMATCH-3050818 - https://snyk.io/vuln/SNYK-JS-NANOID-8492085 Co-authored-by: snyk-io[bot] <141718529+snyk-io[bot]@users.noreply.github.com> * fix: packages/google-cloud-devicestreaming/samples/package.json to reduce vulnerabilities (#204) The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-JSYAML-13961110 Co-authored-by: snyk-io[bot] <141718529+snyk-io[bot]@users.noreply.github.com> * fix: packages/google-cloud-chronicle/samples/package.json to reduce vulnerabilities (#202) The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-JSYAML-13961110 Co-authored-by: snyk-io[bot] <141718529+snyk-io[bot]@users.noreply.github.com> * fix: packages/google-cloud-osconfig/samples/package.json to reduce vulnerabilities (#200) The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-JSYAML-13961110 Co-authored-by: snyk-io[bot] <141718529+snyk-io[bot]@users.noreply.github.com> * feat: Add `OFFLINE` state to Zone resources A new `OFFLINE` state has been added to the `Zone.State` enum. This state indicates that the zone is temporarily not operational, for example, while undergoing maintenance or repair PiperOrigin-RevId: 879057351 Source-Link: googleapis/googleapis@40a49dc Source-Link: https://github.com/googleapis/googleapis-gen/commit/77daef772d6cb525e73509d99da77c54c86cb597 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWdkY2hhcmR3YXJlbWFuYWdlbWVudC8uT3dsQm90LnlhbWwiLCJoIjoiNzdkYWVmNzcyZDZjYjUyNWU3MzUwOWQ5OWRhNzdjNTRjODZjYjU5NyJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * build(deps): bump the npm_and_yarn group across 3 directories with 4 updates Bumps the npm_and_yarn group with 3 updates in the /core/generator/gapic-generator-typescript directory: [protobufjs](https://github.com/protobufjs/protobuf.js), [protobufjs-cli](https://github.com/protobufjs/protobuf.js) and [fast-xml-builder](https://github.com/NaturalIntelligence/fast-xml-builder). Bumps the npm_and_yarn group with 1 update in the /core/packages/gax/test/test-application directory: [@grpc/grpc-js](https://github.com/grpc/grpc-node). Bumps the npm_and_yarn group with 1 update in the /handwritten/cloud-profiler directory: [protobufjs](https://github.com/protobufjs/protobuf.js). Updates `protobufjs` from 7.5.5 to 7.5.6 - [Release notes](https://github.com/protobufjs/protobuf.js/releases) - [Changelog](https://github.com/protobufjs/protobuf.js/blob/protobufjs-v7.5.6/CHANGELOG.md) - [Commits](protobufjs/protobuf.js@protobufjs-v7.5.5...protobufjs-v7.5.6) Updates `protobufjs-cli` from 1.2.0 to 1.2.2 - [Release notes](https://github.com/protobufjs/protobuf.js/releases) - [Changelog](https://github.com/protobufjs/protobuf.js/blob/master/CHANGELOG.md) - [Commits](protobufjs/protobuf.js@protobufjs-cli-v1.2.0...protobufjs-cli-v1.2.2) Updates `fast-xml-builder` from 1.1.5 to 1.2.0 - [Changelog](https://github.com/NaturalIntelligence/fast-xml-builder/blob/main/CHANGELOG.md) - [Commits](NaturalIntelligence/fast-xml-builder@v1.1.5...v1.2.0) Updates `protobufjs` from 7.5.5 to 7.5.6 - [Release notes](https://github.com/protobufjs/protobuf.js/releases) - [Changelog](https://github.com/protobufjs/protobuf.js/blob/protobufjs-v7.5.6/CHANGELOG.md) - [Commits](protobufjs/protobuf.js@protobufjs-v7.5.5...protobufjs-v7.5.6) Updates `protobufjs` from 7.5.5 to 7.5.6 - [Release notes](https://github.com/protobufjs/protobuf.js/releases) - [Changelog](https://github.com/protobufjs/protobuf.js/blob/protobufjs-v7.5.6/CHANGELOG.md) - [Commits](protobufjs/protobuf.js@protobufjs-v7.5.5...protobufjs-v7.5.6) Updates `protobufjs` from 7.5.5 to 7.5.6 - [Release notes](https://github.com/protobufjs/protobuf.js/releases) - [Changelog](https://github.com/protobufjs/protobuf.js/blob/protobufjs-v7.5.6/CHANGELOG.md) - [Commits](protobufjs/protobuf.js@protobufjs-v7.5.5...protobufjs-v7.5.6) Updates `@grpc/grpc-js` from 1.6.12 to 1.14.3 - [Release notes](https://github.com/grpc/grpc-node/releases) - [Commits](https://github.com/grpc/grpc-node/compare/@grpc/grpc-js@1.6.12...@grpc/grpc-js@1.14.3) Updates `protobufjs` from 7.4.0 to 8.2.0 - [Release notes](https://github.com/protobufjs/protobuf.js/releases) - [Changelog](https://github.com/protobufjs/protobuf.js/blob/protobufjs-v7.5.6/CHANGELOG.md) - [Commits](protobufjs/protobuf.js@protobufjs-v7.5.5...protobufjs-v7.5.6) --- updated-dependencies: - dependency-name: protobufjs dependency-version: 7.5.6 dependency-type: direct:production dependency-group: npm_and_yarn - dependency-name: protobufjs-cli dependency-version: 1.2.2 dependency-type: direct:production dependency-group: npm_and_yarn - dependency-name: fast-xml-builder dependency-version: 1.2.0 dependency-type: indirect dependency-group: npm_and_yarn - dependency-name: protobufjs dependency-version: 7.5.6 dependency-type: direct:production dependency-group: npm_and_yarn - dependency-name: protobufjs dependency-version: 7.5.6 dependency-type: direct:production dependency-group: npm_and_yarn - dependency-name: protobufjs dependency-version: 7.5.6 dependency-type: direct:production dependency-group: npm_and_yarn - dependency-name: "@grpc/grpc-js" dependency-version: 1.14.3 dependency-type: direct:production dependency-group: npm_and_yarn - dependency-name: protobufjs dependency-version: 8.2.0 dependency-type: direct:production dependency-group: npm_and_yarn ... Signed-off-by: dependabot[bot] <support@github.com> --------- Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com> Signed-off-by: Dargon789 <64915515+Dargon789@users.noreply.github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com> Co-authored-by: snyk-io[bot] <141718529+snyk-io[bot]@users.noreply.github.com> Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: googleworkspace-bot <googleworkspace-bot@google.com>
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Fixes #<issue_number_goes_here> 🦕
Summary by Sourcery
CI: