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

Actions Artifacts v4 backend #28965

Merged
merged 37 commits into from
Mar 2, 2024
Merged

Conversation

ChristopherHX
Copy link
Contributor

@ChristopherHX ChristopherHX commented Jan 27, 2024

Fixes #28853

Needs both https://gitea.com/gitea/act_runner/pulls/473 and https://gitea.com/gitea/act_runner/pulls/471 on the runner side and patched actions/upload-artifact@v4 / actions/download-artifact@v4, like christopherhx/gitea-upload-artifact@v4 and christopherhx/gitea-download-artifact@v4, to not return errors due to GHES not beeing supported yet.


Known issues

  • official action v4 doesn't allow replace, this is not checked
    • to check this, we need to know if the artifact has been created in the current run_attempt of the job
  • added fixture uses some invalid task token data, which are not used by the test and required by constraints
    • I'm not shure how to generate these fields for a fixture

Open Questions

  • Can we Append Blockstorage?
    • merging chunks like now is inefficient
    • use the url of the backend to upload via a signed url?
    • GitHub returns the azure Blockstorage url for direct upload without any proxy like used in this PR

Workflow used for testing purposes

on:
  push:
jobs:
  _5:
    runs-on: self-hosted
    steps: 
    - run: env
    - run: |
        github:
        ${{ tojson(github) }}
        inputs:
        ${{ tojson(inputs) }}
        matrix:
        ${{ tojson(matrix) }}
        needs:
        ${{ tojson(needs) }}
        strategy:
        ${{ tojson(strategy) }}            
      shell: cp {0} context.txt
    - uses: christopherhx/gitea-upload-artifact@v4
      with:
        name: test
        path: context.txt

    - uses: christopherhx/gitea-download-artifact@v4
      with:
        name: test
        path: out
    - run: cat out/context.txt

preview

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jan 27, 2024
@pull-request-size pull-request-size bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Jan 27, 2024
@github-actions github-actions bot added the modifies/api This PR adds API routes or modifies them label Jan 27, 2024
@pull-request-size pull-request-size bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Feb 2, 2024
@ChristopherHX ChristopherHX marked this pull request as ready for review February 2, 2024 16:55
@lunny lunny added this to the 1.22.0 milestone Feb 8, 2024
@lunny lunny added the type/feature Completely new functionality. Can only be merged if feature freeze is not active. label Feb 8, 2024
@kgdev

This comment was marked as off-topic.

@lunny

This comment was marked as off-topic.

@ChristopherHX
Copy link
Contributor Author

I have noticed that they have added a delete Artifacts api after my initial implementation of the internal ip.

My plan is to update this PR to include that endpoint and add more tests

Uploading a tar archive to the blobstorage as single is possible on GitHub Actions, however the content disposition header in the UI always names it <name>.zip

See here the summary of the changes in this backend following GitHub Actions

@pull-request-size pull-request-size bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Feb 17, 2024
@fuxiaohei fuxiaohei self-assigned this Feb 18, 2024
@GiteaBot GiteaBot added the lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. label Feb 29, 2024
routers/api/actions/artifactsv4.go Outdated Show resolved Hide resolved
@lunny lunny added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Feb 29, 2024
@ChristopherHX
Copy link
Contributor Author

I have noticed in my previous PR that the
--- is not respected to mark content that should not be part of the commit message during PR merge. So this additional content has been manually removed from my side.

@wxiaoguang
Copy link
Contributor

I have noticed in my previous PR that the --- is not respected to mark content that should not be part of the commit message during PR merge. So this additional content has been manually removed from my side.

I have called for "please edit the commit message manually before merge" in the member's discord channel.

But I guess such initiative is seldom followed. (At least, when I merge, I always edit).

@ChristopherHX
Copy link
Contributor Author

Ah I didn't know that stripping the commit message is a manual task. I rather thought that some kind of automation for this would exist that broke. Features like "merge queue / auto merge" doesn't play nicely with it. I will just copy the original pr body back after merge.

@lunny lunny enabled auto-merge (squash) March 2, 2024 08:50
@lunny lunny merged commit a53d268 into go-gitea:main Mar 2, 2024
26 checks passed
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Mar 2, 2024
zjjhot added a commit to zjjhot/gitea that referenced this pull request Mar 2, 2024
* giteaofficial/main:
  Actions Artifacts v4 backend (go-gitea#28965)
  Remove jQuery AJAX from common global functions (go-gitea#29528)
  Allow options to disable user gpg keys configuration from the interface on app.ini (go-gitea#29486)
  [skip ci] Updated translations via Crowdin
  Fix issue & comment history bugs (go-gitea#29525)
  Fix incorrect diff expander for deletion of last lines in a file (go-gitea#29501)
  Ignore `__debug_bin*` which is generated by vscode when debugging (go-gitea#29524)
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/api This PR adds API routes or modifies them size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. type/feature Completely new functionality. Can only be merged if feature freeze is not active.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support actions/upload-artifact@v4, actions/download-artifact@v4
6 participants