1
0
mirror of https://github.com/quay/quay.git synced 2026-01-26 06:21:37 +03:00
Commit Graph

139 Commits

Author SHA1 Message Date
Ryan Wallace
e0c74cb334 feat(sentry): add more comprehensive filtering (PROJQUAY-9436) (#4641)
* feat(sentry): add more comprehensive filtering

* test: add tests for sentry filtering

* fix: conflicting patterns

* feat: filter out OTEL logs

* feat: add more robust 4xx error filtering

* chore(4xx): test

* fix: potential AttributeError on sentry event object

* fix: rm .tool-versions

* fix: parse status codes as ints

* test: add JWT filtering test

* chore: tighten 4xx exceptions

* test: remove some duplicate tests

* chore: add a default error sampling rate of 0.1

* test: add to buildman/sentry tests

* refactor: combine EXCLUDE_PATTERNS into one list

* chore: remove some duplicated tests
2025-12-01 16:11:07 -05:00
jbpratt
71d219cc35 fix(test): prevent MySQL deadlocks in parallel proxy model tests (PROJQUAY-0000) (#4605)
* fix(test): prevent MySQL deadlocks in parallel proxy model tests (PROJQUAY-0000)

Mark all registry proxy model test classes to run serially using
pytest-xdist group markers. These tests all use the same "quayio-cache"
organization and were causing MySQL deadlocks when run in parallel
across multiple workers with pytest -n auto.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix(test): resolve Flask app naming conflict in quotaregistrysizeworker tests (PROJQUAY-0000)

Import Flask app with alias to avoid conflict with pytest 'app' fixture.
The test was using 'app.config' but 'app' resolved to a pytest fixture
definition instead of the Flask application object.

Follows the same pattern as test_securityscanningnotificationworker.py.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Brady Pratt <bpratt@redhat.com>

---------

Signed-off-by: Brady Pratt <bpratt@redhat.com>
Co-authored-by: Claude <noreply@anthropic.com>
2025-11-24 15:28:34 +05:30
Shubhra Deshpande
587dff07f3 fix: Fix race conditions in pull metrics tracking and flushing (PROJQUAY-9776) (#4561)
* Fix race conditions in pull metrics tracking and flushing

Replace non-atomic operations with atomic Redis operations to prevent
data loss when concurrent pulls occur during flush operations.

* fixing tests

* updating tests

* added uuid to the rename factors to ensure unique key at concurrent requests

---------

Co-authored-by: shudeshp <shudeshp@redhat.com>
2025-11-20 09:47:47 -05:00
Shubhra Deshpande
aa1188024d sentry: added additional filtering for sentry events (PROJQUAY-9436) (#4418)
* sentry: added additional filtering for sentry events


---------

Co-authored-by: shudeshp <shudeshp@redhat.com>
2025-10-31 09:42:23 -04:00
Shubhra Deshpande
57101500ea bug: fixing pull statistics Redis flush worker with aggregation support (PROJQUAY-9607) (#4407)
* fixing pull statistics Redis flush worker with aggregation support

---------

Co-authored-by: shudeshp <shudeshp@redhat.com>
2025-10-29 15:23:39 -04:00
Shubhra Deshpande
240d6441ba feat: Add image pull statistics API endpoints and UI integration (PROJQUAY-7176) (#4382)
feat: Add image pull statistics API endpoints and UI integration

- Add new API endpoints for tag and manifest pull statistics
- Integrate pull metrics into web UI with new table columns
- Add FEATURE_IMAGE_PULL_STATS feature flag and PULL_METRICS_REDIS config
- Add pullstatsredisflushworker to supervisord configuration
- Add comprehensive test coverage for pull statistics functionality

Co-authored-by: shudeshp <shudeshp@redhat.com>
2025-10-27 15:19:52 -04:00
Jordi Piriz
42e1941229 refactor: Optimize reconciliation worker API calls and improve metrics (PROJQUAY-8960) (#4380)
Improve reconciliation worker lookup_subscription api calls
2025-10-21 13:12:17 -04:00
Shubhra Deshpande
49ff0da0c2 feat: Added Redis database and Redis flush worker (PROJQUAY-7176) (#4321)
* Added redis database and redis flush worker

* updated digest validation

* adding test coverage for scan_keys function

* adding test coverage

* added tests for scan function

* added coverage for flush to database function

* added coverage for gnuicorn worker initialization

* Replaced mock methods in the test with actual function calls

---------

Co-authored-by: shudeshp <shudeshp@redhat.com>
2025-10-17 09:27:11 -04:00
Jordi Piriz
2964764455 feat: Instrument reconciliationworker (PROJQUAY-8960) (#4357)
* Extend markeplace API client to allow raising exceptions

* Refactor reconciliationworker with clearer logic and instrumentation
2025-10-14 10:05:14 -04:00
Michaela Lang
01908d64db workers(quotaregistrysize): fixed wrong condition to run quotasizeworker from PROJQUAY-8086 (PROJQUAY-9460) (#4313)
PROJQUAY-9460 (fix): Total Registry Size Calculation return 0 KB and always queued
2025-09-26 09:35:02 -04:00
Shubhra Deshpande
57915a5ef3 fix: Fix Sentry transport KeyError in exception logging initialization (PROJQUAY-9198) (#4295)
Fix Sentry transport KeyError in exception logging initialization

Co-authored-by: shudeshp <shudeshp@redhat.com>
2025-09-17 10:40:00 -04:00
Michaela Lang
456470fb8b workers(quotaregistrysize): added to run quotasizeworker when SUPERUSERS are retrieved from LDAP (PROJQUAY-8086) (#3322)
worker(quotaregistrysize) lacks the check to run calculation if no superusers are defined statically but retrieved from LDAP instead.
2025-09-15 13:35:06 -04:00
Shubhra Deshpande
d0f45f545a fix: resolve Sentry/OpenTelemetry integration conflicts (PROJQUAY-9198) (#4232)
* fix: resolve Sentry/OpenTelemetry integration conflicts

Configure Sentry to use minimal integrations when OTEL_TRACING is enabled
to prevent instrumentation conflicts that broke exception capture


---------

Co-authored-by: shudeshp <shudeshp@redhat.com>
2025-09-04 16:19:27 -04:00
Brandon Caton
3f317fb74b proxy: fix err on pulls from public repos if anonymous (PROJQUAY-9346) (#4229)
Check if user exists before putting on queue.
2025-08-27 14:39:03 -04:00
Shubhra Deshpande
22290c9812 deps: updated raven dependency to be compatible with python 3.12 (PROJQUAY-9198) (#4169)
* Updated raven dependency to be compatible with python 3.12

---------

Co-authored-by: shudeshp <shudeshp@redhat.com>
2025-08-07 15:58:59 -04:00
Kenny Lee Sin Cheong
4dc25162d3 proxycache: fix references (PROJQUAY-9106) (#4113)
fixing missing references
2025-07-07 15:08:42 -04:00
Kenny Lee Sin Cheong
40031c2356 proxycache: fix queueitem payload for proxycachblobworker (PROJQUAY-9018) (#4076)
* proxycache: fix queueitem payload for proxycachblobworker (PROJQUAY-9018)

* Add feature flag for proxycacheblobworker

* PROXY_CACHE_BLOB_DOWNLOAD stub
2025-06-18 12:34:43 -04:00
Ivan Bazulic
9be679eb58 mirror: Add job timeout to mirror configurations (PROJQUAY-7249) (#3723)
* mirror: Add job timeout to mirror configurations (PROJQUAY-7249)
Previous global job timeout of 5 minutes was inadequate for big images. The timeout should now be configurable in much the same way as sync is. Minimum job length is 300 seconds/5 minutes.

The PR is still work in progress.

* Fix init db, remove reference to user data in logs

* Fix tests, change repo mirror configuration

* Fix tests, make mirroring cancellable through UI

* Add cancel mirror test, change HTML document to reflect mirror timeout

* Flake8 doesn't like when '==' is used with 'None'

* Fix mirror registry tests

* Add new cypress data to fix cypress tests

* Added ability to define upload chunk size to RADOS driver, small changes to repo mirror HTML page

* Fix database migration to follow HEAD

* Upload new database data for Cypress tests

* Make skopeo_timeout_interval mandatory on API calls

---------

Co-authored-by: Ivan Bazulic <ibazulic@redhat.com>
2025-06-12 19:09:51 +02:00
Emmanuel Ferdman
bf82e26c56 fix: migrate to logging.warning (PROJQUAY-8996) (#3976)
fix: migrate to logging.warning

Signed-off-by: Emmanuel Ferdman <emmanuelferdman@gmail.com>
2025-06-10 13:50:53 -04:00
Kenny Lee Sin Cheong
ed70eff752 proxycache: Download blob not cached when pulling manifests with blobs available locally (PROJQUAY-6708) (#4007)
* proxycache: Download blob not cached when pulling manifests with blob available locally (PROJQUAY-6708)

* Skip downloading blobs without placeholders
2025-06-10 10:34:23 -04:00
Brandon Caton
5c1c21bb1b ci: fixing app type import (PROJQUAY-8991) (#4021)
ci: fixing app type import
2025-06-10 09:14:57 -04:00
Marcus Kok
88221a65d9 chore: reconciler lock match frequency (PROJQUAY-8933) (#3965)
* reconciler lock match frequency

* use config
2025-05-27 15:53:40 -04:00
Marcus Kok
401d059e73 reconciler: Remove database calls for storing/changing web customer ids (PROJQUAY-0000) (#3799)
Remove database calls for storing/changing web customer ids
during reconciler run
2025-04-22 08:56:04 -04:00
Marcus Kok
49a4228e17 reconciler: fix exception when user api is called with empty email (PROJQUAY-5698) (#3798)
* fix exception when user api is called with empty email
2025-04-17 14:14:57 -04:00
Marcus Kok
b629054fe5 reconciler: fix typo in exception type (PROJQUAY-0000) (#3779)
* fix typo in exception type

* update test cases
2025-04-16 09:39:29 -04:00
Marcus Kok
5e2fbd986b marketplace: free tier integration for reconciler (PROJQUAY-5698) (#3589)
free sku integration for reconciliation worker
2025-04-08 08:55:37 -04:00
Marcus Kok
52f3e38413 marketplace: handle exception thrown by stripe when customer has no subscription (PROJQUAY-8431) (#3603)
* handle exception thrown by stripe when customer has no subscription
2025-02-03 14:36:27 -05:00
Marcus Kok
8d835a9a94 worker: include orgs in reconciler runs (PROJQUAY-8431) (#3560)
Adds an include_orgs param to the active users query used by the reconciler and sets it to true for reconciler runs

Reconciler is not including orgs as a candidate for creating corresponding RH entitlements. As a result it misses users with stripe billing that are considered orgs.
2025-01-10 13:05:22 -05:00
Sunandadadi
296b5f35c3 notifications: fetch autoprune tags with multiple policies for image expiry notification (PROJQUAY-8117) (#3340)
* notifications: fetch autoprune tags with multiple policies for image expiry notification(PROJQUAY-8117)

* don't fetch notifications if tags expiry is greater than notification days + add tests
2024-10-18 16:17:07 -04:00
Sunandadadi
409d464cca autoprune: order policies by method before execution (PROJQUAY-8104) (#3334) 2024-10-16 14:35:16 -04:00
Sunandadadi
d39a6f06c3 autoprune: fix tags returned by autoprune worker (PROJQUAY-8070) (#3314)
* autoprune: fix tags returned by autoprune worker (PROJQUAY-8070)

* fixing tests

* moving limit and offset to db_regex_search

* adding test cases
2024-10-11 12:10:59 -04:00
Sunandadadi
f327551ccc autoprune: support multiple organization and repository policies (PROJQUAY-7695) (#3209)
* autoprune: support multiple organization policies (PROJQUAY-7695)

* ui to support multiple org policies

* backend to support multiple repository autoprune policies

* ui: multiple repository policies

* fixing tests

* adding tests
2024-09-20 09:18:09 -04:00
Brandon Caton
6da65c5003 api: adding tag_pattern to autoprune API (PROJQUAY-7668) (#3188)
Allows users to specify a regex tag pattern when creating namespace/repository autoprune policies via the new UI. Users will have the option to prune tags that only match the tag pattern or exclude tags that match the tag pattern.
2024-09-13 09:48:51 -04:00
Kenny Lee Sin Cheong
3cfe2b9bb8 secscan: add option to have securityworkers require lock (PROJQUAY-7661) (#3142) 2024-08-15 16:06:33 +00:00
Ivan Bazulic
62e42f8f54 storage: Disable pushes on registry (PROJQUAY-6870) (#2755)
* storage: Disable pushes on registry (PROJQUAY-6870)

The current read-only option for Quay is not sometimes feasible, since it requires an insert of the service key and other manual config changes. For instance, if you want to just recalculate quota on the registry, but would like to allow all registry operations (including UI) without the possibility of pushes until recalculation is done, setting the whole registry `read-only` cannot be done since it makes the database read only as well.

This PR introduces a new flag called `DISABLE_PUSHES` which allows all registry operations to continue (changing tags, repo editing, robot account creation/deletion, user creation etc.) but will disable pushes of new images to the registry (i.e. backend storage will not change). If a registry already contains the image and a new tag is simply being added, that operation should succeed.

The following message would appear in the logs:

~~~
gunicorn-registry stdout | 2024-03-13 20:19:49,414 [369] [DEBUG] [endpoints.v2] sending response: b'{"errors":[{"code":"METHOD NOT ALLOWED","detail":{},"message":"Pushes to the registry are currently disabled. Please contact the administrator for more information."}]}\n'
gunicorn-registry stdout | 2024-03-13 20:19:49,414 [369] [INFO] [gunicorn.access] 172.17.0.1 - - [13/Mar/2024:20:19:49 +0000] "PUT /v2/ibazulic/mariadb/manifests/sha256:c4694ba424e0259694a5117bbb510d67340051f0bdb7f9fa8033941a2d66e53e HTTP/1.1" 405 169 "-" "skopeo/1.9.3"
nginx stdout | 172.17.0.1 (-) - - [13/Mar/2024:20:19:49 +0000] "PUT /v2/ibazulic/mariadb/manifests/sha256:c4694ba424e0259694a5117bbb510d67340051f0bdb7f9fa8033941a2d66e53e HTTP/1.1" 405 169 "-" "skopeo/1.9.3" (0.002 3813 0.002)
~~~

The flag defaults to `False` (pushes enabled), unless set otherwise.

* Removed constraint on storage replication when pushes are disabled

* Rebase

* Fix isort sorting

* Fix isort sorting #2

* Removed constraint on storage replication when pushes are disabled

* Rebase

* Remove constraint on storage replication worker

* Fix linting on config.py
2024-08-07 15:40:10 -04:00
Kenny Lee Sin Cheong
32890207da registry: index manifest artifact type for filtering (PROJQUAY-7471) (#3035)
Previous assumption made use of the config media type only, which is not the case
if a manifest's artifact type is explicitly set. i.e the config's media type and
artifact type are different, and the artifact type take precedence for filtering.
2024-07-16 22:33:38 +00:00
Sunandadadi
13f6cd590c featureflag: add feature flag for image expiry trigger (PROJQUAY-7460) (#3007)
* feature flag: add feature flag for image expiry trigger (PROJQUAY-7460)

* add FEATURE_IMAGE_EXPIRY_TRIGGER to CLIENT_WHITELIST

* minor fix

* setting IMAGE_EXPIRY_TRIGGER to true for testing

* fixing config.json
2024-07-08 17:43:14 -04:00
Sunandadadi
6688bcca09 backend: implement basic functionality (PROJQUAY-7076) (#2984)
* database: adding subject_backfilled index to manifest table (PROJQUAY-7360) (#2963)

adding subject_backfilled index to manifest table

* Rebasing with main

* updating cypress data

* fixing conflicts and rebasing with latest code

* adding tests

* Forcing an empty commit.

* Forcing an empty commit.

* skip_locked test fix

* adding tests

* minor fixes

---------

Co-authored-by: Brandon Caton <bcaton@redhat.com>
2024-06-27 16:48:39 -04:00
Brandon Caton
7ef664a646 autoprune: Registry level autopruning (PROJQUAY-7392) (#2950)
Allows for adding a default autopruning policy that will be applied to all namespaces.
2024-06-26 16:43:31 -04:00
Daniel Messer
e73d096b28 api: OCI compliant tag listing and pagination (PROJQUAY-6931) (#2884)
implement OCI compliant pagination and tag listing

Signed-off-by: dmesser <dmesser@redhat.com>
2024-06-13 11:28:02 +02:00
Kenny Lee Sin Cheong
4546163e83 registry: implements the OCI 1.1 referrers API (PROJQUAY-7280) (#2597)
* registry: implements the OCI 1.1 referrers API

Migrations:
- Adds a subject column for lookup
- Adds a subject_backfilled column to track status of the backfilling
of existing manifests
- Adds a manifest_json column making use of postgres' JSONB support,
for future use.

Manifestsubjectbackfillworker: Indexes existing manifests for possible
existing subject field.

* Deprecate IGNORE_UNKNOWN_MEDIATYPES

* Cleanup
2024-06-07 13:28:13 -04:00
Marcus Kok
dbfb47d6fb marketplace: change redhatsubscriptions model to return a list of customer ids (PROJQUAY-7129) (#2868)
* marketplace: change redhatsubscriptions model to return a list of customer ids (PROJQUAY-7129)

* Use list comprehension in model and expect to return None if no rows are
returned

* fix behavior for reconciler and fix unit test for reconciler
2024-05-09 11:51:06 -04:00
Marcus Kok
a69a450736 marketplace: change api call to return array of customer ids (PROJQUAY-7129) (#2867)
Changes marketplace api handler to now return a list of all web customer ids for a user.

Allows quay.io to keep track of all web customer ids instead of just personal types.
2024-05-09 09:31:02 -04:00
Sunandadadi
12aece5e87 logs: increase usage logs worker timeout (PROJQUAY-7008) (#2817) 2024-04-15 10:22:27 -04:00
Brandon Caton
d2a1fedab4 quota: refactor, tests, and optimizations (PROJQUAY-6735) (#2712)
Adds the following changes:
- Additional logging
- Moving checks before expensive DB calls
- Additional tests
2024-03-06 09:06:38 -05:00
Harish Govindarajulu
0be8cb7cb1 Add auto-prune tests + fix namespace autoprune policy UI issue (PROJQUAY-6773) (#2717)
Signed-off-by: harishsurf <hgovinda@redhat.com>
2024-03-04 15:29:27 +00:00
Harish Govindarajulu
98811f5397 feat: Add auto-prune policy at repository level (PROJQUAY-6354) (#2691)
* feat: Add support for auto pruning at repository level (PROJQUAY-6354)

* Add repositoryautoprunepolicy table to alembic migration script

* Add repository auto-prune policy endpoints

* Add UI for repository auto-pruning policies

* case: apply repo auto-prune policy when no namespace policy given

* case: both namespace and repo pruning policy are given

* Add tests for repository autoprune endpoint

* Add cypress test for repository auto-prune

* Add repo auto-prune policy clean-up for repository deletion

* Add repository auto pruning tables to quay db snapshot for cypress tests

* Address review comments

* Add more tests + fix CI + reformat files

* Address review comments #2

---------

Signed-off-by: harishsurf <hgovinda@redhat.com>
2024-02-27 15:02:57 +05:30
Marcus Kok
2a4ac09306 billing: marketplace UI (PROJQUAY-6551) (#2595)
* billing: marketplace UI

adds UI in billing section for managing user and org-bound skus

add more unit tests for org binding

changed endpoint for bulk attaching skus to orgs
2024-01-11 11:48:38 -05:00
Marcus Kok
26451766ad marketplace: make sure customer id from api is returned as an int (PROJQUAY-233) (#2590)
* make sure customer id from api is returned as an int
2024-01-08 15:41:34 -05:00
Marcus Kok
1c893baba5 marketplace: update reconciliationworker to use webCustomerId instead of ebsAccountNumber (PROJQUAY-233) (#2582)
* update reconciliationworker to use webCustomerId instead of
ebsAccountNumber

* fix reconciler where it was incorrectly using the ebsAccountNumber to
  create subscriptions
* add job to reconciler so that it reconciles different ids between the
  database and the user api
* separate skus to be used by billing and skus to be used by reconciler
2024-01-05 16:15:37 -05:00