Skip to content

Don't try to deploy nonexistent files #212

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

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

Conversation

ofalvai
Copy link
Contributor

@ofalvai ofalvai commented Jan 31, 2025

Checklist

  • I've read and followed the Contribution Guidelines
  • step.yml and README.md is updated with the changes (if needed)

Version

Requires a MAJOR/MINOR/PATCH version update

Context

List of files to deploy
- /bitrise/src/Apps/app-stg-release-unsigned.apk

Deploying files
Uploading apk file: /bitrise/src/Apps/app-stg-release-unsigned.apk
analyzing apk
Failed to parse APK info: failed to unzip the APK, error: open /bitrise/src/Apps/app-stg-release-unsigned.apk: no such file or directory
deploy failed, error: failed to get apk infos, output: asset W 01-31 12:06:07  2347  2347] Asset path /bitrise/src/Apps/app-stg-release-unsigned.apk is neither a directory nor file (type=1).
ERROR: dump failed because assets could not be loaded, error: exit status 1
deploy failed, error: failed to get apk infos, output: asset W 01-31 12:06:07  2347  2347] Asset path /bitrise/src/Apps/app-stg-release-unsigned.apk is neither a directory nor file (type=1).
ERROR: dump failed because assets could not be loaded, error: exit status 1

Changes

Investigation details

Decisions

@@ -340,6 +341,11 @@ func logDeployFiles(files []deployment.DeployableItem, logger loggerV2.Logger) {
func clearDeployFiles(filesToDeploy []string, logger loggerV2.Logger) []string {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should not we perform the file existence check earlier?

At the moment the step output looks like this:

List of files to deploy
- /bitrise/src/Apps/app-stg-release-unsigned.apk

Deploying files
Uploading apk file: /bitrise/src/Apps/app-stg-release-unsigned.apk
analyzing apk
Failed to parse APK info: failed to unzip the APK, error: open /bitrise/src/Apps/app-stg-release-unsigned.apk: no such file or directory
deploy failed, error: failed to get apk infos, output: asset W 01-31 12:06:07  2347  2347] Asset path /bitrise/src/Apps/app-stg-release-unsigned.apk is neither a directory nor file (type=1).
ERROR: dump failed because assets could not be loaded, error: exit status 1
deploy failed, error: failed to get apk infos, output: asset W 01-31 12:06:07  2347  2347] Asset path /bitrise/src/Apps/app-stg-release-unsigned.apk is neither a directory nor file (type=1).
ERROR: dump failed because assets could not be loaded, error: exit status 1

The step lists that it will deploy the /bitrise/src/Apps/app-stg-release-unsigned.apk file and then later it states it could not deploy the file. Why did it find the file in the first place then?

I would say that we should check if the file exists when we collect the deployable files.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That was my thinking as well! clearDeployFiles() is called right after collecting the files based on the step inputs:

filesToDeploy, err := collectFilesToDeploy(absDeployPth, config, tmpDir, logger)
if err != nil {
fail(logger, "%s", err)
}
clearedFilesToDeploy := clearDeployFiles(filesToDeploy, logger)

And it's called before printing the list of deployable files (L168)

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, I was thinking of doing it earlier like in the collectFilesToDeploy method. My thinking was that why are we even finding files which do not exist. The clear function was created more for filtering out the useless files.

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.

3 participants