Skip to content

Add build environment validation checks#1724

Merged
edmorley merged 1 commit into
mainfrom
add-checks
Dec 13, 2024
Merged

Add build environment validation checks#1724
edmorley merged 1 commit into
mainfrom
add-checks

Conversation

@edmorley

@edmorley edmorley commented Dec 13, 2024

Copy link
Copy Markdown
Member
  • Adds a warning if the Python buildpack has been run multiple times in the same build.
  • Adds a warning if an existing .heroku/python/ directory is found in the app source.
  • Improves the error message shown if the buildpack is used on an unsupported stack. Previously the build would fail with a curl download error depending on the availability of assets on S3. This scenario can only happen outside of Heroku, or if an old buildpack is used with a brand new stack (eg for Heroku-26).

The two warnings are the first step towards #1704 and #1710, and will be turned into errors in January 2025.

Towards #1704 and #1710.
GUS-W-17386432.
GUS-W-17309709.

@edmorley edmorley self-assigned this Dec 13, 2024
@edmorley edmorley marked this pull request as ready for review December 13, 2024 19:19
@edmorley edmorley requested a review from a team as a code owner December 13, 2024 19:19
@edmorley edmorley enabled auto-merge (squash) December 13, 2024 19:21
Comment thread lib/checks.sh Outdated
Comment thread lib/checks.sh
- Adds a warning if the Python buildpack has been run multiple times
  in the same build.
- Adds a warning if an existing `.heroku/python/` directory is found
  in the app source.
- Improves the error message shown if the buildpack is used on an
  unsupported stack. Previously the build would fail with a curl
  download error depending on the availability of assets on S3.
  This scenario can only happen outside of Heroku, or in an old
  buildpack is used with a brand new stack (eg for Heroku-26).

The two warnings are the first step towards #1704 and #1710, and will
be turned into errors in January 2025.

Towards #1704 and #1710.
GUS-W-17386432.
GUS-W-17309709.

@schneems schneems left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Reminds me of heroku/heroku-buildpack-ruby#552.

@edmorley edmorley merged commit 0d42218 into main Dec 13, 2024
@edmorley edmorley deleted the add-checks branch December 13, 2024 21:11
@heroku-linguist heroku-linguist Bot mentioned this pull request Dec 13, 2024
edmorley added a commit that referenced this pull request Jul 10, 2025
Builds will now error if either:
- The Python buildpack has been run multiple times in the same build.
- An existing `.heroku/python/` directory is found in the app source
  for any other reason (e.g. accidentally committed to Git)

This upgrades the warnings added in #1724 in December 2024
to errors.

Zero feedback/concerns were raised in the GitHub issue
linked from the warning:
#1704

And Honeycomb data shows:
- the number of apps hitting the warnings was minimal
- in most cases, the builds hitting the warnings were failing
  already (eg due to broken `python/` directories having been
  committed to Git, and so turning the warning into an error
  will actually give them a better error message than before).

Closes #1704.
GUS-W-17309720.
edmorley added a commit that referenced this pull request Jul 10, 2025
Builds will now error if either:
- The Python buildpack has been run multiple times in the same build.
- An existing `.heroku/python/` directory is found in the app source
  for any other reason (e.g. accidentally committed to Git)

This upgrades the warnings added in #1724 in December 2024
to errors.

Zero feedback/concerns were raised in the GitHub issue
linked from the warning:
#1704

And Honeycomb data shows:
- the number of apps hitting the warnings was minimal
- in most cases, the builds hitting the warnings were failing
  already (eg due to broken `python/` directories having been
  committed to Git, and so turning the warning into an error
  will actually give them a better error message than before).

Closes #1704.
GUS-W-17309720.
edmorley added a commit that referenced this pull request Jul 10, 2025
Builds will now error if either:
- The Python buildpack has been run multiple times in the same build.
- An existing `.heroku/python/` directory is found in the app source
  for any other reason (e.g. accidentally committed to Git)

This upgrades the warnings added in #1724 in December 2024
to errors.

No feedback/concerns were raised in the GitHub issue
linked from the warning:
#1704

And Honeycomb data shows:
- the number of apps hitting the warnings was minimal
- in most cases, the builds hitting the warnings were failing
  already (eg due to broken `python/` directories having been
  committed to Git, and so turning the warning into an error
  will actually give them a better error message than before).

Closes #1704.
GUS-W-17309720.
edmorley added a commit that referenced this pull request Jul 10, 2025
Builds will now error if either:
- The Python buildpack has been run multiple times in the same build.
- An existing `.heroku/python/` directory is found in the app source
  for any other reason (e.g. accidentally committed to Git)

This upgrades the warnings added in #1724 in December 2024
to errors.

No feedback/concerns were raised in the GitHub issue
linked from the warning:
#1704

And Honeycomb data shows:
- the number of apps hitting the warnings was minimal
- in most cases, the builds hitting the warnings were failing
  already (eg due to broken `python/` directories having been
  committed to Git, and so turning the warning into an error
  will actually give them a better error message than before).

Closes #1704.
GUS-W-17309720.
edmorley added a commit that referenced this pull request Jul 10, 2025
Builds will now error if either:
- The Python buildpack has been run multiple times in the same build.
- An existing `.heroku/python/` directory is found in the app source
  for any other reason (e.g. accidentally committed to Git)

This upgrades the warnings added in #1724 in December 2024
to errors.

No feedback/concerns were raised in the GitHub issue
linked from the warning:
#1704

And Honeycomb data shows:
- the number of apps hitting the warnings was minimal
- in most cases, the builds hitting the warnings were failing
  already (eg due to broken `python/` directories having been
  committed to Git, and so turning the warning into an error
  will actually give them a better error message than before).

Closes #1704.
GUS-W-17309720.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

2 participants