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

Add verbose printouts options to git_archive and upload_form #938

Merged
merged 8 commits into from
Jun 19, 2023

Conversation

minhqdao
Copy link
Contributor

@minhqdao minhqdao commented Jun 15, 2023

Add verbose printout options to git_archive and upload_form.

Use run with echo option instead of execute_command_line.

How to test

  • fpm publish --token abc --verbose
  • fpm publish --token abc --verbose --dry-run
  • fpm publish --token abc --verbose --show-package-data

Copy link
Contributor

@perazz perazz left a comment

Choose a reason for hiding this comment

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

lgtm, thanks @minhqdao.

Copy link
Contributor

@urbanjost urbanjost left a comment

Choose a reason for hiding this comment

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

Looks good. Just an optional comment to consider calling run() instead of execute_command_line().

src/fpm/cmd/publish.f90 Show resolved Hide resolved
@minhqdao minhqdao requested a review from urbanjost June 17, 2023 16:02
Copy link
Contributor

@urbanjost urbanjost left a comment

Choose a reason for hiding this comment

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

Looks good. I had a few questions. I am not sure of the meaning of the @ character when printing the scratch archive file name. What does that represent?

Echoing all the commands that actually generate and transfer the file, but I was surprised to see
the output of the "archive -l" command shown. That could be useful for debugging so I am fine with it being intentional, but a litte surprised to see it.

Just wanted to make sure those were intentional; good with everything else.

(
exec 2>&1
set -x
fpm publish --show-package-version
fpm publish --show-upload-data # WHAT IS THE @ CHARACTER REPRESENT?
fpm publish --show-upload-data --show-package-version # ONLY DOES VERSION. OK, BUT SHOULD BE EXCLUSIONARY?
fpm publish --show-package-version --verbose
fpm publish --show-upload-data --verbose # confused by archive -l output :tar tgz tar.gz zip
fpm publish --show-package-version --verbose
fpm publish --show-upload-data --verbose
fpm publish --token dd2588f31a854b52a51018bc874145de --verbose --dry-run
fpm publish --token dd2588f31a854b52a51018bc874145de --dry-run
fpm publish --token dd2588f31a854b52a51018bc874145de
) |tee -a $0
exit

  • fpm publish --show-package-version
    0.1.0
  • fpm publish --show-upload-data
    Upload data:
    package_name="huegif"
    package_license="license"
    package_version="0.1.0"
    tarball=@"/tmp/fileAJ0fld"
    upload_token=" "
  • fpm publish --show-upload-data --show-package-version
    0.1.0
  • fpm publish --show-package-version --verbose
    0.1.0
  • fpm publish --show-upload-data --verbose
    BUILD_NAME: build/gfortran
    COMPILER: gfortran
    C COMPILER: gcc
    CXX COMPILER: g++
    COMPILER OPTIONS: -Wall -Wextra -fPIC -fmax-errors=1 -g -fcheck=bounds -fcheck=array-temps -fbacktrace -fcoarray=single
    C COMPILER OPTIONS:
    CXX COMPILER OPTIONS:
    LINKER OPTIONS:
    INCLUDE DIRECTORIES: []
  • git archive -l > /tmp/filecn7u0B
    tar tgz tar.gz zip
  • git archive HEAD --format=tar.gz -o /tmp/filecHkEHC
    Upload data:
    package_name="huegif"
    package_license="license"
    package_version="0.1.0"
    tarball=@"/tmp/filecHkEHC"
    upload_token=" "
  • fpm publish --show-package-version --verbose
    0.1.0
  • fpm publish --show-upload-data --verbose
    BUILD_NAME: build/gfortran
    COMPILER: gfortran
    C COMPILER: gcc
    CXX COMPILER: g++
    COMPILER OPTIONS: -Wall -Wextra -fPIC -fmax-errors=1 -g -fcheck=bounds -fcheck=array-temps -fbacktrace -fcoarray=single
    C COMPILER OPTIONS:
    CXX COMPILER OPTIONS:
    LINKER OPTIONS:
    INCLUDE DIRECTORIES: []
  • git archive -l > /tmp/fileCRP3h2
    tar tgz tar.gz zip
  • git archive HEAD --format=tar.gz -o /tmp/fileMjAKO4
    Upload data:
    package_name="huegif"
    package_license="license"
    package_version="0.1.0"
    tarball=@"/tmp/fileMjAKO4"
    upload_token=" "
  • fpm publish --token dd2588f31a854b52a51018bc874145de --verbose --dry-run
    BUILD_NAME: build/gfortran
    COMPILER: gfortran
    C COMPILER: gcc
    CXX COMPILER: g++
    COMPILER OPTIONS: -Wall -Wextra -fPIC -fmax-errors=1 -g -fcheck=bounds -fcheck=array-temps -fbacktrace -fcoarray=single
    C COMPILER OPTIONS:
    CXX COMPILER OPTIONS:
    LINKER OPTIONS:
    INCLUDE DIRECTORIES: []
  • git archive -l > /tmp/filebSNxze
    tar tgz tar.gz zip
  • git archive HEAD --format=tar.gz -o /tmp/fileeDb4Ng
    Upload data:
    package_name="huegif"
    package_license="license"
    package_version="0.1.0"
    tarball=@"/tmp/fileeDb4Ng"
    upload_token="dd2588f31a854b52a51018bc874145de"

Dry run successful. Generated tarball: /tmp/fileeDb4Ng

  • fpm publish --token dd2588f31a854b52a51018bc874145de --dry-run
    Dry run successful. Generated tarball: /tmp/fileGy992r
  • fpm publish --token dd2588f31a854b52a51018bc874145de
    Uploading package ...
    % Total % Received % Xferd Average Speed Time Time Time Current
    Dload Upload Total Spent Left Speed
    100 4161 100 108 100 4053 247 9295 --:--:-- --:--:-- --:--:-- 9521
    {"code":400,"message":"Invalid license identifier license. Please check the SPDX license identifier list."}

@minhqdao
Copy link
Contributor Author

Looks good. I had a few questions. I am not sure of the meaning of the @ character when printing the scratch archive file name. What does that represent?

The @ indicates the file to be uploaded. https://everything.curl.dev/http/multipart#file-input

Echoing all the commands that actually generate and transfer the file, but I was surprised to see
the output of the "archive -l" command shown. That could be useful for debugging so I am fine with it being intentional, but a litte surprised to see it.

Yes, this is intentional. I think this is particularly useful if the command is ran, e.g., in the CI, where you can't quickly jump in to check the output by yourself.

@minhqdao minhqdao merged commit 16221b1 into main Jun 19, 2023
23 of 24 checks passed
@minhqdao minhqdao deleted the add-verbose-outputs branch June 19, 2023 08:16
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.

None yet

4 participants