Drop legacy artifacts usage as there are no leftovers
What does this MR do?
After we've done https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/24144/diffs, all legacy artifacts are gone.
We're going to disable all legacy artifacts usage with a feature flag.
Simplify queries which related to searching expired artifacts
Previous query of Ci::Build.with_expired_artifacts
SELECT "ci_builds"."id"
FROM "ci_builds"
WHERE "ci_builds"."type" IN ('Ci::Build') AND
((artifacts_file IS NOT NULL AND artifacts_file <> '') OR
EXISTS (SELECT 1 FROM "ci_job_artifacts" WHERE (ci_builds.id = ci_job_artifacts.job_id) AND "ci_job_artifacts"."file_type" = 1))
AND (artifacts_expire_at < '2019-01-10 09:36:50.618692');
New query of Ci::Build.with_expired_artifacts
SELECT "ci_builds"."id"
FROM "ci_builds"
WHERE "ci_builds"."type" IN ('Ci::Build') AND
(EXISTS (SELECT 1 FROM "ci_job_artifacts" WHERE (ci_builds.id = ci_job_artifacts.job_id) AND "ci_job_artifacts"."file_type" = 1))
AND (artifacts_expire_at < '2019-01-10 09:35:59.869233');
Feature flag
The usage can be leveraged by ci_enable_legacy_artifacts
. We can technically remove all legacy artifacts related code, however, there might be an edge case or we encounter unexpected error. So using a feature flag is safer option. Also, this merge request accomplishes a part of https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/23358.
What are the relevant issue numbers?
- Related: https://gitlab.com/gitlab-org/gitlab-ce/issues/41057
- Related: https://gitlab.com/gitlab-org/gitlab-ce/issues/58595
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary - [-] Documentation created/updated
-
Tests added for this feature/bug - [-] Tested in all supported browsers
-
Conforms to the code review guidelines -
Conforms to the merge request performance guidelines -
Conforms to the style guides -
Conforms to the database guides - [-] Link to e2e tests MR added if this MR has Requires e2e tests label. See the Test Planning Process.
-
Security reports checked/validated by reviewer
Edited by Kamil Trzciński (Back 2025-01-01)