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

Uploaded artifacts should be overwritten #28549

Closed
hakito opened this issue Dec 20, 2023 · 7 comments
Closed

Uploaded artifacts should be overwritten #28549

hakito opened this issue Dec 20, 2023 · 7 comments
Assignees
Labels
topic/gitea-actions related to the actions of Gitea type/bug
Milestone

Comments

@hakito
Copy link
Contributor

hakito commented Dec 20, 2023

Description

According to github documentation artifacts sharing the same name should be overwritten.

Gitea seems to discard/ignore the second upload. Here is an example workflow:

name: Uploads
on:
  - push

jobs:
  first:
    name: upload first
    runs-on: windows
    steps:
      - run: echo "first" > actual
      - uses: actions/upload-artifact@v3
        with:
          name: actual
          path: actual
  second:
    needs: [first]
    name: upload second
    runs-on: windows
    steps:
      - run: echo "second" > actual
      - uses: actions/upload-artifact@v3
        with:
          name: actual
          path: actual
  verify:
    needs: [second]
    name: Verify contents
    runs-on: windows
    steps:
      - name: Fetch Integration Tests from Build
        uses: actions/download-artifact@v3
        with:
          name: actual
      - run: echo "second" > expected
      - run: fc.exe expected actual

Gitea Version

1.21.2

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

image

Git Version

No response

Operating System

No response

How are you running Gitea?

gitea/gitea:latest

Database

MySQL/MariaDB

@hakito
Copy link
Contributor Author

hakito commented Dec 20, 2023

Side note:

We are currently migrating our build system to gitea, and this could have become a critical problem.

We first build our software and upload the binaries. In a second job we overwrite the encrypted binaries. If I hadn't checked manually, the unencrypted version would be shipped!

@lunny lunny added the topic/gitea-actions related to the actions of Gitea label Dec 20, 2023
@lunny
Copy link
Member

lunny commented Dec 20, 2023

Can you run that on github successfully?

@hakito
Copy link
Contributor Author

hakito commented Dec 20, 2023

@fuxiaohei fuxiaohei self-assigned this Dec 21, 2023
@hakito
Copy link
Contributor Author

hakito commented Dec 28, 2023

FYI - Also when re-running a job it keeps the old artifacts.

@lunny
Copy link
Member

lunny commented Dec 28, 2023

FYI - Also when re-running a job it keeps the old artifacts.

Wow, so this is a bug?

@hakito
Copy link
Contributor Author

hakito commented Dec 29, 2023

Well I would consider it a bug if I successfully upload an artifact (with re-run), but the artifact is not the uploaded. I made a very simple example do demonstrate it:

on: [push]
jobs:
  Timestamp:
    runs-on: [windows]
    steps:
      - run: get-date -Format "o" > timestamp.txt
      - run: cat timestamp.txt
      - uses: actions/upload-artifact@v3
        with:
            path: timestamp.txt           

Simply run the job a 2nd time manually. After the 2nd run the output of cat timestamp.txt in web interface is:

2023-12-29T08:17:55.7576776+01:00

But the content of the downloaded artifact is:

2023-12-29T08:17:03.1341990+01:00

lunny pushed a commit that referenced this issue Jan 17, 2024
Fix `Uploaded artifacts should be overwritten`
#28549

When upload different content to uploaded artifact, it checks that
content size is not match in db record with previous artifact size, then
the new artifact is refused.

Now if it finds uploading content size is not matching db record when
receiving chunks, it updates db records to follow the latest size value.
GiteaBot pushed a commit to GiteaBot/gitea that referenced this issue Jan 17, 2024
Fix `Uploaded artifacts should be overwritten`
go-gitea#28549

When upload different content to uploaded artifact, it checks that
content size is not match in db record with previous artifact size, then
the new artifact is refused.

Now if it finds uploading content size is not matching db record when
receiving chunks, it updates db records to follow the latest size value.
fuxiaohei added a commit to fuxiaohei/gitea that referenced this issue Jan 17, 2024
Fix `Uploaded artifacts should be overwritten`
go-gitea#28549

When upload different content to uploaded artifact, it checks that
content size is not match in db record with previous artifact size, then
the new artifact is refused.

Now if it finds uploading content size is not matching db record when
receiving chunks, it updates db records to follow the latest size value.
fuxiaohei added a commit to fuxiaohei/gitea that referenced this issue Jan 17, 2024
Fix `Uploaded artifacts should be overwritten`
go-gitea#28549

When upload different content to uploaded artifact, it checks that
content size is not match in db record with previous artifact size, then
the new artifact is refused.

Now if it finds uploading content size is not matching db record when
receiving chunks, it updates db records to follow the latest size value.
lunny pushed a commit that referenced this issue Jan 22, 2024
…28832)

Backport #28726 by @fuxiaohei

Fix Uploaded artifacts should be overwritten
#28549

When upload different content to uploaded artifact, it checks that
content size is not match in db record with previous artifact size, then
the new artifact is refused.

Now if it finds uploading content size is not matching db record when
receiving chunks, it updates db records to follow the latest size value.
henrygoodman pushed a commit to henrygoodman/gitea that referenced this issue Jan 31, 2024
Fix `Uploaded artifacts should be overwritten`
go-gitea#28549

When upload different content to uploaded artifact, it checks that
content size is not match in db record with previous artifact size, then
the new artifact is refused.

Now if it finds uploading content size is not matching db record when
receiving chunks, it updates db records to follow the latest size value.
DennisRasey pushed a commit to DennisRasey/forgejo that referenced this issue Jan 31, 2024
…(#28832)

Backport go-gitea/gitea#28726 by @fuxiaohei

Fix Uploaded artifacts should be overwritten
go-gitea/gitea#28549

When upload different content to uploaded artifact, it checks that
content size is not match in db record with previous artifact size, then
the new artifact is refused.

Now if it finds uploading content size is not matching db record when
receiving chunks, it updates db records to follow the latest size value.

(cherry picked from commit 7f0ce2d)
@lunny lunny added this to the 1.21.5 milestone Feb 2, 2024
@lunny lunny closed this as completed Feb 2, 2024
silverwind pushed a commit to silverwind/gitea that referenced this issue Feb 20, 2024
Fix `Uploaded artifacts should be overwritten`
go-gitea#28549

When upload different content to uploaded artifact, it checks that
content size is not match in db record with previous artifact size, then
the new artifact is refused.

Now if it finds uploading content size is not matching db record when
receiving chunks, it updates db records to follow the latest size value.
Copy link

Automatically locked because of our CONTRIBUTING guidelines

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
topic/gitea-actions related to the actions of Gitea type/bug
Projects
None yet
Development

No branches or pull requests

3 participants