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

Postpone mkdir until start of upload #1956

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

denik
Copy link
Contributor

@denik denik commented Dec 4, 2024

Changes

Move MkdirsByPath call outside of sync.New because sync.New is also used by "bundle validate" which is supposed to be side-effect-free.

Instead, remember if the path existed or not and then create it in RunOnce().

Tests

Extended TestAccEmptyBundleDeploy to also do "bundle validate" and to check that the path does appear but after deploy and not after validate.

@denik denik temporarily deployed to test-trigger-is December 4, 2024 19:49 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is December 4, 2024 19:50 — with GitHub Actions Inactive
@denik denik force-pushed the DECO-23879--do-not-create-path branch from 22c7110 to bbd42c0 Compare December 5, 2024 11:12
@denik denik temporarily deployed to test-trigger-is December 5, 2024 11:12 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is December 5, 2024 11:13 — with GitHub Actions Inactive
@denik denik changed the title WIP - Extend empty_bundle_test.go to check if remote path is created prematurely Postpone directory creation until start of upload Dec 5, 2024
@denik denik changed the title Postpone directory creation until start of upload Postpone mkdir until start of upload Dec 5, 2024
return err
}
return false, nil

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we still test if we have permission to write to a parent that does exist?

We run this during validation, so if we cannot write to the destination path, it's good to surface early.

@denik denik force-pushed the DECO-23879--do-not-create-path branch from bbd42c0 to 8c90966 Compare December 10, 2024 13:41
@denik denik temporarily deployed to test-trigger-is December 10, 2024 13:41 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is December 10, 2024 13:42 — with GitHub Actions Inactive
This ensure that "bundle validate" does not create remote directory.

Extend empty_bundle_test.go to check if remote path is created prematurely
@denik denik force-pushed the DECO-23879--do-not-create-path branch from 8c90966 to 48048dd Compare December 11, 2024 15:31
@denik denik temporarily deployed to test-trigger-is December 11, 2024 15:31 — with GitHub Actions Inactive
Copy link

If integration tests don't run automatically, an authorized user can run them manually by following the instructions below:

Trigger:
go/deco-tests-run/cli

Inputs:

  • PR number: 1956
  • Commit SHA: 48048ddd55478a45ef1603f3cc8332df242e13ed

Checks will be approved automatically on success.

@denik denik temporarily deployed to test-trigger-is December 11, 2024 15:31 — with GitHub Actions Inactive
@eng-dev-ecosystem-bot
Copy link
Collaborator

Test Details: go/deco-tests/12279631939

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.

4 participants