-
Notifications
You must be signed in to change notification settings - Fork 4
Initial implementation #3
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
Merged
Merged
Changes from all commits
Commits
Show all changes
71 commits
Select commit
Hold shift + click to select a range
719f105
Functions MVP
edmorley d87a78d
Install salesforce-functions from PyPI now it's been published
edmorley 4e5ba1e
Fix CI after salesforce-functions 0.2.0 release
edmorley fca044c
Bump minimum Rust version to 1.66
edmorley 406f255
Only use major versions in Cargo.toml
edmorley f687559
Skip check changelog for Dependabot PRs
edmorley 35a6dde
Refresh lockfile
edmorley 11efc72
Remove support for skipping check-changelog using the PR description
edmorley f518418
Update buildpacks/github-actions to 5.0.1
edmorley cc2fb09
Remove workarounds for slow M1 performance
edmorley d0ed798
Refresh Cargo.lock
edmorley fb848be
Update test after salesforce-functions v0.3.0 release
edmorley a4abc3f
Remove functions integration test for too-old Python
edmorley 40aa0af
Remove caching support from the pip layer
edmorley 2abc573
Add VSCode configs
edmorley ef88b80
Bump minimum Rust version to 1.67
edmorley 1be9dc4
Refresh Cargo.lock
edmorley 42343e3
Switch Dependabot to monthly
edmorley 3489dc5
Switch GitHub Action runner image back to `ubuntu-latest`
edmorley eb98a86
Remove now-unused test fixture
edmorley 47d06d5
Pass detect for non-functions too
edmorley 76c2822
Update to pip 23.0, setuptools 67.0.0, wheel 0.38.4
edmorley da42891
Clean up functions handling
edmorley 1ac2ec6
More unit tests, rustdocs and comments
edmorley 448921e
Switch buildpack ID back to `heroku/python`
edmorley 92046bb
Test `heroku/buildpacks:20` in CI too
edmorley 6c32581
Shorten CI job name
edmorley d849fae
Update Cargo dependencies
edmorley f85f39d
Update to setuptools 67.1.0
edmorley bbe592d
Remove notes.md
edmorley d5bb909
Update LICENSE year
edmorley 2f66e68
Move fixtures under tests/fixtures/
edmorley 7387625
Switch check-changelog to `ubuntu-latest`
edmorley 8ef2a84
Fix functions integration test after 0.5.0 release
edmorley 70373e5
Add CHANGELOG.md
edmorley 1d2db46
Only run CI on PRs not branches
edmorley a53fd3e
Switch from env var to `--disable-pip-version-check`
edmorley c9bae31
Python/pip layer refactoring + unit tests
edmorley 631b212
Refresh Cargo.lock
edmorley 391519e
Cleanup errors.rs
edmorley bb01b50
Add `.env_clear()` to all `Command` usages
edmorley 49fdb60
Refactor pip dependencies layer env handling + add a test
edmorley 2b6bf42
s/env/command_env/
edmorley 4ad4245
More rustdocs/comments
edmorley 09083da
s/functions/salesforce_functions/
edmorley ea35f11
Improve naming of error enums and their variants
edmorley 401984a
Clean up SOURCE_DATE_EPOCH usages
edmorley 7e5873b
Bump default Python to the newly released 3.11.2
edmorley f8ccc42
Switch back to using `PIP_DISABLE_PIP_VERSION_CHECK`
edmorley 1924ef0
Add integration tests
edmorley a8febff
Try `--test-threads 10` for integration tests in CI
edmorley a7e3148
`--test-threads 6`
edmorley 544dba9
`--test-threads 4`
edmorley 04d0c16
`--test-threads 5`
edmorley fa4b16e
Update Swatinem/rust-cache to v2.2.1
edmorley 457a017
Improve cache and logging
edmorley 583b04f
Refactor Python runtime archive URL generation
edmorley 2a92049
Update dependencies
edmorley 9bc83dd
Refactor PackagingToolVersions
edmorley 9048996
More rustdocs
edmorley c602666
Refactor integration tests
edmorley ff1c62c
Add work item numbers to some of the TODOs
edmorley f22600c
Misc cleanup
edmorley b189360
Address review comments
edmorley e95f00e
Add a release script
edmorley 630d74f
Add duplicate version check to release workflow
edmorley 7dce0d5
Fix comment typo
edmorley 1922305
Clarify comment about env var inheritance
edmorley 55349e4
Fix comment typo in package_manager.rs
edmorley b2b796f
Update to setuptools 67.5.0
edmorley dd390e9
Refresh Cargo.lock
edmorley File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* @heroku/languages |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "cargo" | ||
directory: "/" | ||
schedule: | ||
interval: "monthly" | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "monthly" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Check Changelog | ||
|
||
on: | ||
pull_request: | ||
types: [opened, reopened, labeled, unlabeled, synchronize] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
check-changelog: | ||
runs-on: ubuntu-latest | ||
if: | | ||
!contains(github.event.pull_request.labels.*.name, 'skip changelog') && | ||
!contains(github.event.pull_request.labels.*.name, 'dependencies') | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Check that CHANGELOG is touched | ||
run: | | ||
git fetch origin ${{ github.base_ref }} --depth 1 && \ | ||
git diff remotes/origin/${{ github.base_ref }} --name-only | grep CHANGELOG.md |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
# Avoid duplicate builds on PRs. | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
permissions: | ||
contents: read | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Update Rust toolchain | ||
run: rustup update | ||
- name: Rust Cache | ||
uses: Swatinem/[email protected] | ||
- name: Clippy | ||
run: cargo clippy --all-targets --locked -- --deny warnings | ||
- name: rustfmt | ||
run: cargo fmt -- --check | ||
|
||
unit-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Update Rust toolchain | ||
run: rustup update | ||
- name: Rust Cache | ||
uses: Swatinem/[email protected] | ||
- name: Run unit tests | ||
run: cargo test --locked | ||
|
||
integration-test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
builder: ["builder:22", "buildpacks:20"] | ||
env: | ||
INTEGRATION_TEST_CNB_BUILDER: heroku/${{ matrix.builder }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Install musl-tools | ||
run: sudo apt-get install musl-tools --no-install-recommends | ||
- name: Update Rust toolchain | ||
run: rustup update | ||
- name: Install Rust linux-musl target | ||
run: rustup target add x86_64-unknown-linux-musl | ||
- name: Rust Cache | ||
uses: Swatinem/[email protected] | ||
- name: Install Pack CLI | ||
uses: buildpacks/github-actions/[email protected] | ||
- name: Run integration tests | ||
# Runs only tests annotated with the `ignore` attribute (which in this repo, are the integration tests). | ||
run: cargo test --locked -- --ignored --test-threads 5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
name: Release Buildpack | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: write | ||
|
||
env: | ||
BUILDPACK_DOCKER_REPO: docker.io/heroku/buildpack-python | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
# Releases the buildpack to Docker Hub and registers it with the CNB Buildpack Registry. | ||
# This release process intentionally does not create a .cnb file release for now, since | ||
# there are currently no use-cases that need it for Python. | ||
release: | ||
name: Release heroku/python | ||
runs-on: ubuntu-latest | ||
steps: | ||
# Setup | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Install musl-tools | ||
run: sudo apt-get install musl-tools --no-install-recommends | ||
- name: Update Rust toolchain | ||
run: rustup update | ||
- name: Install Rust linux-musl target | ||
run: rustup target add x86_64-unknown-linux-musl | ||
- name: Rust Cache | ||
uses: Swatinem/[email protected] | ||
- name: Install libcnb-cargo | ||
run: cargo install libcnb-cargo | ||
- name: Install Pack CLI | ||
uses: buildpacks/github-actions/[email protected] | ||
- name: Install yj and crane | ||
uses: buildpacks/github-actions/[email protected] | ||
- name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: docker.io | ||
username: ${{ secrets.DOCKER_HUB_USER }} | ||
password: ${{ secrets.DOCKER_HUB_TOKEN }} | ||
|
||
# Build | ||
- name: Compile the buildpack | ||
run: cargo libcnb package --release | ||
|
||
# Publish | ||
- name: Read buildpack metadata | ||
run: | | ||
echo "buildpack_id=$(yj -t < buildpack.toml | jq -r .buildpack.id)" >> $GITHUB_ENV | ||
echo "buildpack_version=$(yj -t < buildpack.toml | jq -r .buildpack.version)" >> $GITHUB_ENV | ||
- name: Check version is unique on Docker Hub | ||
run: | | ||
if docker manifest inspect "${{ env.BUILDPACK_DOCKER_REPO }}:${{ env.buildpack_version }}" > /dev/null; then | ||
echo "Duplicate version found on Docker Hub ${{ env.BUILDPACK_DOCKER_REPO }}:${{ env.buildpack_version }}" | ||
exit 1 | ||
fi | ||
- name: Publish the buildpack to Docker Hub | ||
run: pack buildpack package --path target/buildpack/release/heroku_python --publish "${{ env.BUILDPACK_DOCKER_REPO }}:${{ env.buildpack_version }}" | ||
- name: Calculate the buildpack image digest | ||
run: echo "buildpack_digest=$(crane digest ${{ env.BUILDPACK_DOCKER_REPO }}:${{ env.buildpack_version }})" >> $GITHUB_ENV | ||
- name: Register the new version with the CNB Buildpack Registry | ||
uses: docker://ghcr.io/buildpacks/actions/registry/request-add-entry:5.0.1 | ||
with: | ||
token: ${{ secrets.CNB_REGISTRY_RELEASE_BOT_GITHUB_TOKEN }} | ||
id: ${{ env.buildpack_id }} | ||
version: ${{ env.buildpack_version }} | ||
address: ${{ env.BUILDPACK_DOCKER_REPO }}@${{ env.buildpack_digest }} | ||
- name: Create GitHub release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: v${{ env.buildpack_version }} | ||
release_name: v${{ env.buildpack_version }} | ||
body: | | ||
See the [CHANGELOG](./CHANGELOG.md) for details. | ||
draft: false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
__pycache__/ | ||
target/ | ||
.DS_Store |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"recommendations": ["rust-lang.rust-analyzer"], | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"rust-analyzer.check.command": "clippy", | ||
"rust-analyzer.imports.granularity.enforce": true, | ||
"rust-analyzer.imports.granularity.group": "module", | ||
"rust-analyzer.imports.prefix": "crate", | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Changelog | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | ||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
||
## [Unreleased] | ||
|
||
### Added | ||
|
||
- Initial implementation. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.