Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI Pipeline Compatibility #124

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

TravisCalder
Copy link

What did you implement:

  • Add "strictMode" functionality
    • "strictMode" is on by default
    • When enabled, an error is thrown when no Rust builds are found
    • When disabled, the error is suppressed
    • "strictMode" can be disabled with custom.rust.strictMode: false
  • Fix validation warning
    • serverless does not accept "rust" as a runtime
    • a function can be marked as "rust" the old way, or by adding tags.language: "rust"
  • Support predefined artifacts and skip recompile
    • This allows an artifact to be built in one CI-step and deployed in another
    • When artifact is defined, the artifact zip is uploaded and compile is skipped

Closes: #123

How did you verify your change:

Change was verified locally using npm link locally. The following scenarios were verified:

  • custom.rust.strictMode set to false, provider changed to provided.al2
    • This resulted in no builds, since no rust functions were found, but no errors
  • Set top-level provider.runtime to provided.al2 and added tags: language: "rust"
    • This resulted in the Rust function being correctly identified and compiled
  • Added param:artifact as per linked issue
    • When built with serverless deploy --stage stage, compile occurred as per usual
    • When built with serverless deploy --stage stage --param="artifact=path/file.zip" build was skipped and provided artifact was deployed

- Add "strictMode" functionality
  - "strictMode" is on by default
  - When enabled, an error is thrown when no Rust builds are found
  - When disabled, the error is suppressed
  - "strictMode" can be disabled with custom.rust.strictMode: false
- Fix validation warning
  - serverless does not accept "rust" as a runtime
  - a function can be marked as "rust" the old way, or by adding tags.language: "rust"
- Support predefined artifacts and skip recompile
  - This allows an artifact to be built in one CI-step and deployed in another
  - When artifact is defined, the artifact zip is uploaded and compile is skipped
@seanpianka
Copy link

Thanks for these changes! I think at this point in this project lifecycle, you might be be better off starting your own fork of this project since this version of it has been abandoned.

I have been looking at gathering the changes from the different PR's available, and pre-existing forks, and merging them into one that we can continue development on.

- Update tests to correct some pre-existing failures and test around strictMode
@TravisCalder
Copy link
Author

I noticed when I forked that some tests weren't passing.

Added a commit with lint passing (my mistake), updates to the test for my code, and fixes to the pre-existing failures.

@TravisCalder
Copy link
Author

Thanks for these changes! I think at this point in this project lifecycle, you might be be better off starting your own fork of this project since this version of it has been abandoned.

I have been looking at gathering the changes from the different PR's available, and pre-existing forks, and merging them into one that we can continue development on.

We did fork internally and it's working like a charm, but I figured it only made sense to at least offer it back.

Low expectations on getting it merged in, but at the very least the diff is there for others who want similar behaviour.

@nrodriguez-chub
Copy link

@TravisCalder you have just implemented what I was planning to do!
This part to skip the build, is critical for us :D :D :
https://github.com/TravisCalder/serverless-rust/blob/master/index.js#L303
Did you publish a public release of this or are you planning to do so?
Thanks!

@TravisCalder
Copy link
Author

TravisCalder commented Dec 26, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support CI/CD Pipelines using Artifacts
3 participants