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

xz, gh: deny network access #169720

Merged
merged 2 commits into from Apr 30, 2024
Merged

xz, gh: deny network access #169720

merged 2 commits into from Apr 30, 2024

Conversation

alebcay
Copy link
Member

@alebcay alebcay commented Apr 22, 2024

  • Have you followed the guidelines for contributing?
  • Have you ensured that your commits follow the commit style guide?
  • Have you checked that there aren't other open pull requests for the same formula update/change?
  • Have you built your formula locally with HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>, where <formula> is the name of the formula you're submitting?
  • Is your test running fine brew test <formula>, where <formula> is the name of the formula you're submitting?
  • Does your build pass brew audit --strict <formula> (after doing HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>)? If this is a new formula, does it pass brew audit --new <formula>?

Expected to fail without Homebrew/brew#17081.

@alebcay alebcay added the CI-no-bottles Merge without publishing bottles label Apr 22, 2024
@github-actions github-actions bot added CI-linux-self-hosted Build on Linux self-hosted runner long build Needs CI-long-timeout labels Apr 22, 2024
@carlocab carlocab added CI-skip-dependents Pass --skip-dependents to brew test-bot. and removed CI-linux-self-hosted Build on Linux self-hosted runner long build Needs CI-long-timeout labels Apr 22, 2024
Formula/x/xz.rb Outdated Show resolved Hide resolved
Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

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

Thanks @alebcay!

Would be nice to see a usage of when this also e.g. only denies some methods.

@github-actions github-actions bot added CI-linux-self-hosted Build on Linux self-hosted runner long build Needs CI-long-timeout labels Apr 23, 2024
@SMillerDev
Copy link
Member

I'd suggest blocking cURL from network in the build step and not in the others

@MikeMcQuaid
Copy link
Member

Expected to fail without Homebrew/brew#17081.

It was merged so rerunning CI now.

@SMillerDev
Copy link
Member

I guess the stable tap_syntax is cancelling the normal one

@alebcay
Copy link
Member Author

alebcay commented Apr 23, 2024

Indeed, looks like test-bot is using latest brew tag (not latest master) so this CI will not pass until the aforementioned PR lands in a tag.

@MikeMcQuaid MikeMcQuaid added the CI-no-fail-fast Continue CI tests despite failing GitHub Actions matrix builds. label Apr 23, 2024
@SMillerDev
Copy link
Member

I think that label only applies to OS testing, we need the stable syntax check to be continue-on-error to fix this

@MikeMcQuaid
Copy link
Member

I think that label only applies to OS testing, we need the stable syntax check to be continue-on-error to fix this

Should be able to have it just not kill the main tap syntax job without a fail fast in the matrix or similar.

@SMillerDev
Copy link
Member

Should be able to have it just not kill the main tap syntax job without a fail fast in the matrix or similar.

Since I don't see any reason to ever kill the main syntax job because of the stable one, I ignored this and made a fix with my comment: #169867

@alebcay alebcay changed the title xz: deny network access during formula build, install, and test xz, gh: deny network access Apr 24, 2024
@carlocab carlocab removed the long build Needs CI-long-timeout label Apr 24, 2024
@github-actions github-actions bot added the long build Needs CI-long-timeout label Apr 29, 2024
@alebcay alebcay removed the long build Needs CI-long-timeout label Apr 29, 2024
@alebcay
Copy link
Member Author

alebcay commented Apr 29, 2024

N.B.: resources used by the test block that need download will fail when network access is blocked; unlike for package build, where resources are downloaded before entering the sandbox, the download for test resources occur inside the sandbox.

@github-actions github-actions bot added the long build Needs CI-long-timeout label Apr 29, 2024
@alebcay alebcay removed the long build Needs CI-long-timeout label Apr 29, 2024
@alebcay alebcay marked this pull request as ready for review April 29, 2024 22:13
@MikeMcQuaid
Copy link
Member

MikeMcQuaid commented Apr 30, 2024

Looks good, let's try this out!

N.B.: resources used by the test block that need download will fail when network access is blocked; unlike for package build, where resources are downloaded before entering the sandbox, the download for test resources occur inside the sandbox.

I think there's probably a DSL addition required to indicate a test-only resource and brew fetch --include-test or similar can download it in advance.

@BrewTestBot BrewTestBot added this pull request to the merge queue Apr 30, 2024
Merged via the queue into master with commit 2264e00 Apr 30, 2024
25 checks passed
@BrewTestBot BrewTestBot deleted the xz-deny-network-access branch April 30, 2024 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI-linux-self-hosted Build on Linux self-hosted runner CI-no-bottles Merge without publishing bottles CI-no-fail-fast Continue CI tests despite failing GitHub Actions matrix builds. CI-skip-dependents Pass --skip-dependents to brew test-bot.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants