diff --git a/.circleci/config.yml b/.circleci/config.yml index dd645d15..2cd20e5c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -110,4 +110,4 @@ workflows: - main: filters: tags: - only: /.*/ + only: /v.*/ diff --git a/.github/workflows/build-and-push.yml b/.github/workflows/build-and-push.yml index c11dbad4..bfc9a92f 100644 --- a/.github/workflows/build-and-push.yml +++ b/.github/workflows/build-and-push.yml @@ -83,7 +83,7 @@ jobs: echo DEPLOYMENT_ENV=prod >> "$GITHUB_ENV" - name: Push the Docker image to GAR if: env.IMAGE_TAG != '' - uses: mozilla-it/deploy-actions/docker-push@v3.9.0 + uses: mozilla-it/deploy-actions/docker-push@v3.11.1 with: local_image: local/antenna_deploy_base:latest image_repo_path: ${{ secrets.DOCKER_IMAGE_PATH }} diff --git a/antenna/health_resource.py b/antenna/health_resource.py index 2230d9bd..22da977a 100644 --- a/antenna/health_resource.py +++ b/antenna/health_resource.py @@ -5,6 +5,7 @@ from collections import OrderedDict import json import logging +import os import falcon import markus @@ -35,11 +36,20 @@ def __init__(self, basedir): def on_get(self, req, resp): """Implement GET HTTP request.""" mymetrics.incr("version.count") - version_info = json.dumps(get_version_info(self.basedir)) + version_info = get_version_info(self.basedir) + # FIXME(willkg): there's no cloud provider environment variable to use, so + # we'll cheat and look at whether there's a "gcs" in + # CRASHMOVER_CRASHSTORAGE_CLASS; this is termporary and we can remove it + # once we've finished the GCP migration + version_info["cloud"] = ( + "GCP" + if "gcs" in os.environ.get("CRASHMOVER_CRASHSTORAGE_CLASS", "") + else "AWS" + ) resp.content_type = "application/json; charset=utf-8" resp.status = falcon.HTTP_200 - resp.text = version_info + resp.text = json.dumps(version_info) class LBHeartbeatResource: diff --git a/bin/run_tests.sh b/bin/run_tests.sh index 2aa146fc..a2312b37 100755 --- a/bin/run_tests.sh +++ b/bin/run_tests.sh @@ -21,7 +21,6 @@ echo ">>> pytest" export PYTHONPATH=/app/:${PYTHONPATH:-} PYTEST="$(which pytest)" -PYTHON="$(which python)" # Wait for services to be ready (both have the same endpoint url) urlwait "${CRASHMOVER_CRASHPUBLISH_ENDPOINT_URL}" 15 diff --git a/docker-compose.yml b/docker-compose.yml index dccd94b7..a4629058 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -120,7 +120,7 @@ services: # https://hub.docker.com/r/localstack/localstack/ # localstack running a fake S3 and SQS localstack: - image: localstack/localstack:1.1.0 + image: localstack/localstack:3.4.0 environment: - SERVICES=s3,sqs - DEFAULT_REGION=us-east-1 diff --git a/pyproject.toml b/pyproject.toml index a0de01f6..f78e4da0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,12 +1,13 @@ [tool.ruff] +line-length = 88 +target-version = "py311" + +[tool.ruff.lint] # Enable pycodestyle (E), pyflakes (F), bugbear (B), and bandit (S) rules select = ["E", "F", "B", "S"] -line-length = 88 -# Ignore line length violations that aren't fixed by formatting ignore = ["E501"] -target-version = "py311" -[tool.ruff.flake8-quotes] +[tool.ruff.lint.flake8-quotes] docstring-quotes = "double" [tool.ruff.lint.per-file-ignores] @@ -48,7 +49,7 @@ github_project = "antenna" bugzilla_product = "Socorro" bugzilla_component = "Infra" main_branch = "main" -tag_name_template = "%Y.%m.%d" +tag_name_template = "v%Y.%m.%d" [tool.service-status] diff --git a/requirements.in b/requirements.in index 43dfae49..7187e051 100644 --- a/requirements.in +++ b/requirements.in @@ -1,29 +1,29 @@ # Production requirements -attrs==23.1.0 -boto3==1.28.78 -botocore==1.31.78 -datadog==0.47.0 -dockerflow==2022.8.0 -everett==3.2.0 -falcon==3.1.1 -fillmore==1.1.0 -google-cloud-storage +attrs==23.2.0 +boto3==1.34.95 +botocore==1.34.95 +datadog==0.49.1 +dockerflow==2024.4.2 +everett==3.3.0 +falcon==3.1.3 +fillmore==1.2.0 +google-cloud-storage==2.16.0 gunicorn==22.0.0 isodate==0.6.1 markus==4.2.0 -sentry-sdk==1.34.0 -google-cloud-pubsub==2.19.3 +sentry-sdk==1.45.0 +google-cloud-pubsub==2.21.1 # Development requirements -bandit==1.7.5 +bandit==1.7.8 click==8.1.7 -freezegun==1.2.2 -more-itertools==10.1.0 -pip-tools==7.3.0 -pytest==7.4.3 +freezegun==1.5.0 +more-itertools==10.2.0 +pip-tools==7.4.1 +pytest==8.2.0 requests==2.31.0 -ruff==0.1.3 -Sphinx==7.2.6 -sphinx-rtd-theme==1.3.0 +ruff==0.4.2 +Sphinx==7.3.7 +sphinx-rtd-theme==2.0.0 urlwait==1.0 -werkzeug==3.0.1 +werkzeug==3.0.2 diff --git a/requirements.txt b/requirements.txt index 175cbb33..aaea90c6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,13 +4,13 @@ # # pip-compile --generate-hashes --strip-extras # -alabaster==0.7.13 \ - --hash=sha256:1ee19aca801bbabb5ba3f5f258e4422dfa86f82f3e9cefb0859b283cdd7f62a3 \ - --hash=sha256:a27a4a084d5e690e16e01e03ad2b2e552c61a65469419b907243193de1a84ae2 +alabaster==0.7.16 \ + --hash=sha256:75a8b99c28a5dad50dd7f8ccdd447a121ddb3892da9e53d1ca5cca3106d58d65 \ + --hash=sha256:b46733c07dce03ae4e150330b975c75737fa60f0a7c591b6c8bf4928a28e2c92 # via sphinx -attrs==23.1.0 \ - --hash=sha256:1f28b4522cdc2fb4256ac1a020c78acf9cba2c6b461ccd2c126f3aa8e8335d04 \ - --hash=sha256:6279836d581513a26f1bf235f9acd333bc9115683f14f7e8fae46c98fc50e015 +attrs==23.2.0 \ + --hash=sha256:935dc3b529c262f6cf76e50877d35a4bd3c1de194fd41f47a2b7ae8f19971f30 \ + --hash=sha256:99b87a485a5820b23b879f04c2305b44b951b502fd64be915879d77a7e8fc6f1 # via # -r requirements.in # fillmore @@ -18,17 +18,17 @@ babel==2.13.1 \ --hash=sha256:33e0952d7dd6374af8dbf6768cc4ddf3ccfefc244f9986d4074704f2fbd18900 \ --hash=sha256:7077a4984b02b6727ac10f1f7294484f737443d7e2e66c5e4380e41a3ae0b4ed # via sphinx -bandit==1.7.5 \ - --hash=sha256:75665181dc1e0096369112541a056c59d1c5f66f9bb74a8d686c3c362b83f549 \ - --hash=sha256:bdfc739baa03b880c2d15d0431b31c658ffc348e907fe197e54e0389dd59e11e +bandit==1.7.8 \ + --hash=sha256:36de50f720856ab24a24dbaa5fee2c66050ed97c1477e0a1159deab1775eab6b \ + --hash=sha256:509f7af645bc0cd8fd4587abc1a038fc795636671ee8204d502b933aee44f381 # via -r requirements.in -boto3==1.28.78 \ - --hash=sha256:aa970b1571321846543a6e615848352fe7621f1cb96b4454e919421924af95f7 \ - --hash=sha256:ff8df4bb5aeb69acc64959a74b31042bfc52d64ca77dbe845a72c8062c48d179 +boto3==1.34.95 \ + --hash=sha256:decf52f8d5d8a1b10c9ff2a0e96ee207ed79e33d2e53fdf0880a5cbef70785e0 \ + --hash=sha256:e836b71d79671270fccac0a4d4c8ec239a6b82ea47c399b64675aa597d0ee63b # via -r requirements.in -botocore==1.31.78 \ - --hash=sha256:320c70bc412157813c2cf60217a592b4b345f8e97e4bf3b1ce49b6be69ed8965 \ - --hash=sha256:a9ca8deeb3f47a10a25637859fee8d81cac2db37ace819d24471279e44879547 +botocore==1.34.95 \ + --hash=sha256:6bd76a2eadb42b91fa3528392e981ad5b4dfdee3968fa5b904278acf6cbf15ff \ + --hash=sha256:ead5823e0dd6751ece5498cb979fd9abf190e691c8833bcac6876fd6ca261fa7 # via # -r requirements.in # boto3 @@ -145,13 +145,13 @@ click==8.1.7 \ # via # -r requirements.in # pip-tools -datadog==0.47.0 \ - --hash=sha256:47be3b2c3d709a7f5b709eb126ed4fe6cc7977d618fe5c158dd89c2a9f7d9916 \ - --hash=sha256:a45ec997ab554208837e8c44d81d0e1456539dc14da5743687250e028bc809b7 +datadog==0.49.1 \ + --hash=sha256:4a56d57490ea699a0dfd9253547485a57b4120e93489defadcf95c66272374d6 \ + --hash=sha256:4cb7a7991af6cadb868fe450cd456473e65f11fc678b7d7cf61044ff1c6074d8 # via -r requirements.in -dockerflow==2022.8.0 \ - --hash=sha256:cebd5e12ff08be43b02ea4fcaf044fb2cd4cec63c93dbfbe6e3c5b610849924c \ - --hash=sha256:fcb95ea8226551e1fd03c3c82f2b11de50434ddfa63cebc164399dabf5c78908 +dockerflow==2024.4.2 \ + --hash=sha256:b9f92455449ba46555f57db34cccefc4c49d3533c67793624ab7e80a1625caa7 \ + --hash=sha256:f4216a3a809093860d7b2db84ba0a25c894cb8eb98b74f4f6a04badbc4f6b0a4 # via -r requirements.in docutils==0.18.1 \ --hash=sha256:23010f129180089fbcd3bc08cfefccb3b890b0050e1ca00c867036e9d161b98c \ @@ -159,65 +159,57 @@ docutils==0.18.1 \ # via # sphinx # sphinx-rtd-theme -everett==3.2.0 \ - --hash=sha256:80517946d9746734ff8e6bda56d629f0092083389730c72157745f8d5d43d196 \ - --hash=sha256:cdca5fc8815f402df650444eb1a2fa24c05ef524ff3ebbae3310d17edb11ea6a +everett==3.3.0 \ + --hash=sha256:acb7b8f3c5fc9692a8ba14fb257e4649f87bea4856e7406c2e9b6c2cab889105 \ + --hash=sha256:d3ecc55cc1bdf2408ca82bc8db5a3fc588fc4c0f236a6ab9599938f41970b814 # via -r requirements.in -falcon==3.1.1 \ - --hash=sha256:00e6c6b3ec846193cfd30be26b10dbb7cc31ee3442f80f1d5ffd14c410619156 \ - --hash=sha256:016fe952a526045292fb591f4c724d5fdf4127e88d0369e2dc147925dc51835c \ - --hash=sha256:10ff3080aebe84fb45955cb02375ce13b6a3556c73edad282325eb67aeb42a46 \ - --hash=sha256:13121ab6a86597ec849e397272662f5cafcbe534e12c01e2913035fe4120dcd1 \ - --hash=sha256:1b8dfce6c379ba14d962abf479137258c694017752bc5b585ab366e2e8106a3e \ - --hash=sha256:1cf50b9a2dcf9c8f6ae8de94e2e6ac082449380784fb9d1a1fc80fade052aead \ - --hash=sha256:1d9c3dc6c5a8a2f2c3f1fd433a6b4e4bcef22c52166b91e2d6d985fbcadcc62b \ - --hash=sha256:271fa0c4b0634e4e238dc7c2fcd57be5f9dd0f200553e46677ff704f6a8090e6 \ - --hash=sha256:2abecd50121ed969fa34d5c035a340ee4b21afc84dcd354acd548ab2edcc67b2 \ - --hash=sha256:394e16249d9b61dcdbb6653311c4a208f9fc68b696d0123d29f781fbd338cfd4 \ - --hash=sha256:550566250ac2bc0418075f2ad177b7e01adef1815459c2d962e579dff07162fb \ - --hash=sha256:5af63f2d7f509353552b2436501449065f30f27542d1e58c864656bd3a7a9ef1 \ - --hash=sha256:5dd393dbf01cbaf99493893de4832121bd495dc49a46c571915b79c59aad7ef4 \ - --hash=sha256:6245344fab1a7faeb9267c75b8f4fd6c4bda35e1a2fe8f547b832b547c7f2128 \ - --hash=sha256:66d937b7b796b68640d63e006e475d9268f68dfb3f1468415259507db72ee065 \ - --hash=sha256:686a0167af40565a2057f3902a9fb8f15a423ad17a80c9caee932b668478c9ad \ - --hash=sha256:6fbc130a12e35ca76d782201af7a558ac57d4e5e66ba3a8017f5a3baaed64f8b \ - --hash=sha256:762854cc9f13082166c166c93fd6f2178ba1787170bacee9a4b37fab412f602e \ - --hash=sha256:7a7ecb8eafada89389c19eda44811e14786599c1d86c6cffa58c65150b24bc43 \ - --hash=sha256:8a5fa02feaf67a2bd0407201dfec92edb0eee59803c3e1e717cfa5a2232ffc77 \ - --hash=sha256:8fc0ef213d6e66bb997d172ceaa04f6daa309cac47e2fcd4320234806c806467 \ - --hash=sha256:a7e6e1e6af16d1055454eaed5ceaceabca97656b28a8a924b426fbf0e26ec0f0 \ - --hash=sha256:b7aab2dd6683437d8739a0cc9d6ab6542f48e05445a0138b356f63983a7c98fe \ - --hash=sha256:b8302953d72405750450d4f8b7651dc6c5a5199dbb104b598036818f917b1d8c \ - --hash=sha256:bec014dc19a38d5a525ab948a8eccc885f28d2611bdf3f73842fadc44b185702 \ - --hash=sha256:ca798f3240283a89881209dfa8eb20e2eaf8d01c50b33be5f70865c0902577ec \ - --hash=sha256:d53dabcf8212c38137e40a61795e312224dc7a437b03d7fb0a1b0dc3ed8d4b5b \ - --hash=sha256:f049eeeeea08e0a5fbb87d1fe131f85c7a0310c3a0a4226146463709fbfe12eb \ - --hash=sha256:f187040b6632ed434c3f6bcedb98fb6559973123d1799e77718502d2b693701e \ - --hash=sha256:f6e3c42f3c20af33c040affe0a3e8cd358153304b48eb441adfd261c3bfd51d3 \ - --hash=sha256:fd1eaf1a5d9d936f29f9aca3f268cf375621d1ffcbf27a6e14c187b489bf5f26 \ - --hash=sha256:ff2eaf9807ea357ced1cc60e1d2871f55aa6ea29162386efb95fb4e5a730e6de +falcon==3.1.3 \ + --hash=sha256:04a92f159d392098a11d14b8ca71d17129d8b1ef37b7a3577f1f8bcb7b3aecba \ + --hash=sha256:094d295a767e2aa84f07bec6b23e9ebe2e43cde81d9d583bef037168bd775ad6 \ + --hash=sha256:12432c3f6bce46fe4eec3db6db8d2df1abe43a7531219356f1ba859db207e57b \ + --hash=sha256:19b2ce8a613a29a9eaf8243ca285ebf80464e8a6489dff60425f850fb5548936 \ + --hash=sha256:1c335f1118a6e42f08cf30d56914a0bc0d470aa6db7619fdc4c546b184f38248 \ + --hash=sha256:23335dbccd44f29e85ec55f2f35d5a0bc12bd7a509f641ab81f5c64b65626263 \ + --hash=sha256:24aa51ba4145f05649976c33664971ef36f92846208bd9d4d4158ceb51bc753f \ + --hash=sha256:3cda76fb21568aa058ce454fa6272ca5b2582ebb0efcb7ae0090d3bf6d0db5af \ + --hash=sha256:508fdf30617cf1fa5c9d3058c14124dc8e5f7e316e26dca22d974f916493fd0e \ + --hash=sha256:51bbbfa1ecb1d50bed9f8ae940b0f1049d958e945f1a08891769d40cfabe6fb2 \ + --hash=sha256:56e8a4728fb0193e2ccd5301d864fd9743a989cc228e709e5c49ff1025cc1a4f \ + --hash=sha256:57d51f556ece73766f07ede57f17fa65dbbc2cc5e1c7075fb606f727464ad71e \ + --hash=sha256:656e738e0e220f4503e4f07747b564f4459da159a1f32ec6d2478efb651278dd \ + --hash=sha256:7471aab646875d4478377065246a4115aaf3c0801a6eb4b6871f9836c8ef60b1 \ + --hash=sha256:796a57046b0717bff5ac488235c37ea63834a5cfc2c9291c5eeaa43c53e5e24c \ + --hash=sha256:7a1ee54bf19d9c7f998edd8ac21ab8ead1e2f73c24822237eb5485890979a25d \ + --hash=sha256:7b210c05b38a8d655e16aa3ae2befaa70ecfb49bef73c0c1995566b22afcfdd1 \ + --hash=sha256:8b203408040e87e8323e1c1921b106353fa5fe5dc05c9b3f4881acb3af03f556 \ + --hash=sha256:9c82cb54bbf67861febe80d394c9b7bfa0d2e16cc998b69bfff4e8b003c721a2 \ + --hash=sha256:9e2fe54081f1cedc71462eff8dca074045d14380a4bca163882c6c4353f65af2 \ + --hash=sha256:ad37c46322122f34e228be4fe7ae5fcfedb630eef788a198fbdff5971091d5dc \ + --hash=sha256:adc23ced91c4690042a11a0515c5cfe93eeeb7d063940900aee85f8eae7460ec \ + --hash=sha256:c6319883789ee3abcbde2dc10fed8016cc3d9a05018ae59944838b892101111a \ + --hash=sha256:ca3c6cbcba90e272f60581fb3c4561cdcd0ac6d19672f5a11a04309b1d23fa66 \ + --hash=sha256:cb6b6a79d096b3a1f2f37f66f46a2cf18deb575db6dee9935057e6036d98d01f \ + --hash=sha256:cbd40435e99255e40ccfa849e4809cd1638fd8eccc08931fc9d355a6840a7332 \ + --hash=sha256:d52a05be5c2ef364853cdc6d97056dd880a534016db73b95f5a6ebc652577533 \ + --hash=sha256:d56d9a9886387585ce4547354c9929bf5743394df04a17df6ed51ad6bb58a4cc \ + --hash=sha256:d6b7131e85dff13abaacb4ff479c456256f0d57b262b1fb1771180f7535cc902 \ + --hash=sha256:d78a6cfe2d135632673def489a19474e2508d83475c7662c4fa63be0ba82dd81 \ + --hash=sha256:db78171113a3920f0f33d8dd26364527a362db2d1c3376a95778653ff87dea24 \ + --hash=sha256:e19a0a3827821bcf754a9b24217e3b8b4750f7eb437c4a8c461135a86ca9b1c5 \ + --hash=sha256:e1f622d73111912021b8311d1e5d1eabef484217d2d30abe3d237533cb225ce9 # via -r requirements.in -fillmore==1.1.0 \ - --hash=sha256:68b2aa27340725026d7be1e4e96c3ec3ef954f66410e1cb65d0d85a692f0fdc1 \ - --hash=sha256:8afe5fa0f59d99bc10f2996d23755860dd8b8f1aebe96c34fd5d0e5e1c2e0771 +fillmore==1.2.0 \ + --hash=sha256:1968a2ba5adc17ebef362df51ec958c3d78427a77d2218a2709aabc3598eeceb \ + --hash=sha256:c95f7172614c256fe162e93ae6d5beb07e45e1fe7f71b94f5a08eab45dc58a40 # via -r requirements.in -freezegun==1.2.2 \ - --hash=sha256:cd22d1ba06941384410cd967d8a99d5ae2442f57dfafeff2fda5de8dc5c05446 \ - --hash=sha256:ea1b963b993cb9ea195adbd893a48d573fda951b0da64f60883d7e988b606c9f +freezegun==1.5.0 \ + --hash=sha256:200a64359b363aa3653d8aac289584078386c7c3da77339d257e46a01fb5c77c \ + --hash=sha256:ec3f4ba030e34eb6cf7e1e257308aee2c60c3d038ff35996d7475760c9ff3719 # via -r requirements.in -gitdb==4.0.11 \ - --hash=sha256:81a3407ddd2ee8df444cbacea00e2d038e40150acfa3001696fe0dcf1d3adfa4 \ - --hash=sha256:bf5421126136d6d0af55bc1e7c1af1c397a34f5b7bd79e776cd3e89785c2b04b - # via gitpython -gitpython==3.1.40 \ - --hash=sha256:22b126e9ffb671fdd0c129796343a02bf67bf2994b35449ffc9321aa755e18a4 \ - --hash=sha256:cf14627d5a8049ffbf49915732e5eddbe8134c3bdb9d476e6182b676fc573f8a - # via bandit google-api-core==2.17.0 \ --hash=sha256:08ed79ed8e93e329de5e3e7452746b734e6bf8438d8d64dd3319d21d3164890c \ --hash=sha256:de7ef0450faec7c75e0aea313f29ac870fdc44cfaec9d6499a9a17305980ef66 # via - # google-api-core # google-cloud-core # google-cloud-pubsub # google-cloud-storage @@ -233,13 +225,13 @@ google-cloud-core==2.4.1 \ --hash=sha256:9b7749272a812bde58fff28868d0c5e2f585b82f37e09a1f6ed2d4d10f134073 \ --hash=sha256:a9e6a4422b9ac5c29f79a0ede9485473338e2ce78d91f2370c01e730eab22e61 # via google-cloud-storage -google-cloud-pubsub==2.19.3 \ - --hash=sha256:9745ab5fe13270abdfb558c8512933c6a5b73ebbf69565e64b606509d65b1b46 \ - --hash=sha256:b8848d8050b835d702f8206475992cf01074de4f8b5e0875035035115f98f2d9 +google-cloud-pubsub==2.21.1 \ + --hash=sha256:31fcf07444b7f813a616c4b650e1fbf1dc998a088fe0059a76164855ac17f05c \ + --hash=sha256:55a3602ec45bc09626604d712032288a8ee3566145cb83523cff908938f69a4b # via -r requirements.in -google-cloud-storage==2.14.0 \ - --hash=sha256:2d23fcf59b55e7b45336729c148bb1c464468c69d5efbaee30f7201dd90eb97e \ - --hash=sha256:8641243bbf2a2042c16a6399551fbb13f062cbc9a2de38d6c0bb5426962e9dbd +google-cloud-storage==2.16.0 \ + --hash=sha256:91a06b96fb79cf9cdfb4e759f178ce11ea885c79938f89590344d079305f5852 \ + --hash=sha256:dda485fa503710a828d01246bd16ce9db0823dc51bbca742ce96a6817d58669f # via -r requirements.in google-crc32c==1.5.0 \ --hash=sha256:024894d9d3cfbc5943f8f230e23950cd4906b2fe004c72e29b209420a1e6b05a \ @@ -399,9 +391,9 @@ gunicorn==22.0.0 \ --hash=sha256:350679f91b24062c86e386e198a15438d53a7a8207235a78ba1b53df4c4378d9 \ --hash=sha256:4a0b436239ff76fb33f11c07a16482c521a7e09c1ce3cc293c2330afe01bec63 # via -r requirements.in -idna==3.4 \ - --hash=sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4 \ - --hash=sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2 +idna==3.7 \ + --hash=sha256:028ff3aadf0609c1fd278d8ea3089299412a7a8b9bd005dd08b9f8285bcb5cfc \ + --hash=sha256:82fee1fc78add43492d3a1898bfa6d8a904cc97d8427f683ed8e798d07761aa0 # via requests imagesize==1.4.1 \ --hash=sha256:0d8d18d08f840c19d0ee7ca1fd82490fdc3729b7ac93f49870406ddde8ef8d8b \ @@ -415,9 +407,9 @@ isodate==0.6.1 \ --hash=sha256:0751eece944162659049d35f4f549ed815792b38793f07cf73381c1c87cbed96 \ --hash=sha256:48c5881de7e8b0a0d648cb024c8062dc84e7b840ed81e864c7614fd3c127bde9 # via -r requirements.in -jinja2==3.1.2 \ - --hash=sha256:31351a702a408a9e7595a8fc6150fc3f43bb6bf7e319770cbc0db9df9437e852 \ - --hash=sha256:6088930bfe239f0e6710546ab9c19c9ef35e29792895fed6e6e31a023a182a61 +jinja2==3.1.3 \ + --hash=sha256:7d6d50dd97d52cbc355597bd845fabfbac3f551e1f99619e39a35ce8c370b5fa \ + --hash=sha256:ac8bd6544d4bb2c9792bf3a159e80bba8fda7f07e81bc3aed565432d5925ba90 # via sphinx jmespath==1.0.1 \ --hash=sha256:02e2e4cc71b5bcab88332eebf907519190dd9e6e82107fa7f83b1003a6252980 \ @@ -501,9 +493,9 @@ mdurl==0.1.2 \ --hash=sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8 \ --hash=sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba # via markdown-it-py -more-itertools==10.1.0 \ - --hash=sha256:626c369fa0eb37bac0291bce8259b332fd59ac792fa5497b59837309cd5b114a \ - --hash=sha256:64e0735fcfdc6f3464ea133afe8ea4483b1c5fe3a3d69852e6503b43a0b222e6 +more-itertools==10.2.0 \ + --hash=sha256:686b06abe565edfab151cb8fd385a05651e1fdf8f0a14191e4439283421f8684 \ + --hash=sha256:8fccb480c43d3e99a00087634c06dd02b0d50fbf088b380de5a41a015ec239e1 # via -r requirements.in packaging==23.2 \ --hash=sha256:048fb0e9405036518eaaf48a55953c750c11e1a1b68e0dd1a9d62ed0c092cfc5 \ @@ -517,13 +509,13 @@ pbr==5.11.1 \ --hash=sha256:567f09558bae2b3ab53cb3c1e2e33e726ff3338e7bae3db5dc954b3a44eef12b \ --hash=sha256:aefc51675b0b533d56bb5fd1c8c6c0522fe31896679882e1c4c63d5e4a0fccb3 # via stevedore -pip-tools==7.3.0 \ - --hash=sha256:8717693288720a8c6ebd07149c93ab0be1fced0b5191df9e9decd3263e20d85e \ - --hash=sha256:8e9c99127fe024c025b46a0b2d15c7bd47f18f33226cf7330d35493663fc1d1d +pip-tools==7.4.1 \ + --hash=sha256:4c690e5fbae2f21e87843e89c26191f0d9454f362d8acdbd695716493ec8b3a9 \ + --hash=sha256:864826f5073864450e24dbeeb85ce3920cdfb09848a3d69ebf537b521f14bcc9 # via -r requirements.in -pluggy==1.3.0 \ - --hash=sha256:cf61ae8f126ac6f7c451172cf30e3e43d3ca77615509771b3a984a0730651e12 \ - --hash=sha256:d89c696a773f8bd377d18e5ecda92b7a3793cbe66c87060a6fb58c7b6e1061f7 +pluggy==1.5.0 \ + --hash=sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1 \ + --hash=sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669 # via pytest proto-plus==1.23.0 \ --hash=sha256:89075171ef11988b3fa157f5dbd8b9cf09d65fffee97e29ce403cd8defba19d2 \ @@ -567,10 +559,12 @@ pygments==2.16.1 \ pyproject-hooks==1.0.0 \ --hash=sha256:283c11acd6b928d2f6a7c73fa0d01cb2bdc5f07c57a2eeb6e83d5e56b97976f8 \ --hash=sha256:f271b298b97f5955d53fb12b72c1fb1948c22c1a6b70b315c54cedaca0264ef5 - # via build -pytest==7.4.3 \ - --hash=sha256:0d009c083ea859a71b76adf7c1d502e4bc170b80a8ef002da5806527b9591fac \ - --hash=sha256:d989d136982de4e3b29dabcc838ad581c64e8ed52c11fbe86ddebd9da0818cd5 + # via + # build + # pip-tools +pytest==8.2.0 \ + --hash=sha256:1733f0620f6cda4095bbf0d9ff8022486e91892245bb9e7d5542c018f612f233 \ + --hash=sha256:d507d4482197eac0ba2bae2e9babf0672eb333017bcedaa5fb1a3d42c1174b3f # via -r requirements.in python-dateutil==2.8.2 \ --hash=sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86 \ @@ -647,32 +641,32 @@ rsa==4.9 \ --hash=sha256:90260d9058e514786967344d0ef75fa8727eed8a7d2e43ce9f4bcf1b536174f7 \ --hash=sha256:e38464a49c6c85d7f1351b0126661487a7e0a14a50f1675ec50eb34d4f20ef21 # via google-auth -ruff==0.1.3 \ - --hash=sha256:0b6c55f5ef8d9dd05b230bb6ab80bc4381ecb60ae56db0330f660ea240cb0d4a \ - --hash=sha256:0f75e670d529aa2288cd00fc0e9b9287603d95e1536d7a7e0cafe00f75e0dd9d \ - --hash=sha256:12fd53696c83a194a2db7f9a46337ce06445fb9aa7d25ea6f293cf75b21aca9f \ - --hash=sha256:1c595193881922cc0556a90f3af99b1c5681f0c552e7a2a189956141d8666fe8 \ - --hash=sha256:2e3de9ed2e39160800281848ff4670e1698037ca039bda7b9274f849258d26ce \ - --hash=sha256:3ba6145369a151401d5db79f0a47d50e470384d0d89d0d6f7fab0b589ad07c34 \ - --hash=sha256:3e7afcbdcfbe3399c34e0f6370c30f6e529193c731b885316c5a09c9e4317eef \ - --hash=sha256:4874c165f96c14a00590dcc727a04dca0cfd110334c24b039458c06cf78a672e \ - --hash=sha256:76dd49f6cd945d82d9d4a9a6622c54a994689d8d7b22fa1322983389b4892e20 \ - --hash=sha256:7a18df6638cec4a5bd75350639b2bb2a2366e01222825562c7346674bdceb7ea \ - --hash=sha256:918b454bc4f8874a616f0d725590277c42949431ceb303950e87fef7a7d94cb3 \ - --hash=sha256:b46d43d51f7061652eeadb426a9e3caa1e0002470229ab2fc19de8a7b0766901 \ - --hash=sha256:b8afeb9abd26b4029c72adc9921b8363374f4e7edb78385ffaa80278313a15f9 \ - --hash=sha256:ca3cf365bf32e9ba7e6db3f48a4d3e2c446cd19ebee04f05338bc3910114528b \ - --hash=sha256:d8859605e729cd5e53aa38275568dbbdb4fe882d2ea2714c5453b678dca83784 \ - --hash=sha256:dc3ec4edb3b73f21b4aa51337e16674c752f1d76a4a543af56d7d04e97769613 \ - --hash=sha256:eec2dd31eed114e48ea42dbffc443e9b7221976554a504767ceaee3dd38edeb8 +ruff==0.4.2 \ + --hash=sha256:0e2e06459042ac841ed510196c350ba35a9b24a643e23db60d79b2db92af0c2b \ + --hash=sha256:1f32cadf44c2020e75e0c56c3408ed1d32c024766bd41aedef92aa3ca28eef68 \ + --hash=sha256:22e306bf15e09af45ca812bc42fa59b628646fa7c26072555f278994890bc7ac \ + --hash=sha256:24016ed18db3dc9786af103ff49c03bdf408ea253f3cb9e3638f39ac9cf2d483 \ + --hash=sha256:33bcc160aee2520664bc0859cfeaebc84bb7323becff3f303b8f1f2d81cb4edc \ + --hash=sha256:3afabaf7ba8e9c485a14ad8f4122feff6b2b93cc53cd4dad2fd24ae35112d5c5 \ + --hash=sha256:5ec481661fb2fd88a5d6cf1f83403d388ec90f9daaa36e40e2c003de66751798 \ + --hash=sha256:652e4ba553e421a6dc2a6d4868bc3b3881311702633eb3672f9f244ded8908cd \ + --hash=sha256:6a2243f8f434e487c2a010c7252150b1fdf019035130f41b77626f5655c9ca22 \ + --hash=sha256:6ab165ef5d72392b4ebb85a8b0fbd321f69832a632e07a74794c0e598e7a8376 \ + --hash=sha256:7891ee376770ac094da3ad40c116258a381b86c7352552788377c6eb16d784fe \ + --hash=sha256:799eb468ea6bc54b95527143a4ceaf970d5aa3613050c6cff54c85fda3fde480 \ + --hash=sha256:82986bb77ad83a1719c90b9528a9dd663c9206f7c0ab69282af8223566a0c34e \ + --hash=sha256:8772130a063f3eebdf7095da00c0b9898bd1774c43b336272c3e98667d4fb8fa \ + --hash=sha256:8d14dc8953f8af7e003a485ef560bbefa5f8cc1ad994eebb5b12136049bbccc5 \ + --hash=sha256:cbd1e87c71bca14792948c4ccb51ee61c3296e164019d2d484f3eaa2d360dfaf \ + --hash=sha256:ec4ba9436a51527fb6931a8839af4c36a5481f8c19e8f5e42c2f7ad3a49f5069 # via -r requirements.in -s3transfer==0.7.0 \ - --hash=sha256:10d6923c6359175f264811ef4bf6161a3156ce8e350e705396a7557d6293c33a \ - --hash=sha256:fd3889a66f5fe17299fe75b82eae6cf722554edca744ca5d5fe308b104883d2e +s3transfer==0.10.1 \ + --hash=sha256:5683916b4c724f799e600f41dd9e10a9ff19871bf87623cc8f491cb4f5fa0a19 \ + --hash=sha256:ceb252b11bcf87080fb7850a224fb6e05c8a776bab8f2b64b7f25b969464839d # via boto3 -sentry-sdk==1.34.0 \ - --hash=sha256:76dd087f38062ac6c1e30ed6feb533ee0037ff9e709974802db7b5dbf2e5db21 \ - --hash=sha256:e5d0d2b25931d88fa10986da59d941ac6037f742ab6ff2fce4143a27981d60c3 +sentry-sdk==1.45.0 \ + --hash=sha256:1ce29e30240cc289a027011103a8c83885b15ef2f316a60bcc7c5300afa144f1 \ + --hash=sha256:509aa9678c0512344ca886281766c2e538682f8acfa50fd8d405f8c417ad0625 # via # -r requirements.in # fillmore @@ -682,17 +676,13 @@ six==1.16.0 \ # via # isodate # python-dateutil -smmap==5.0.1 \ - --hash=sha256:dceeb6c0028fdb6734471eb07c0cd2aae706ccaecab45965ee83f11c8d3b1f62 \ - --hash=sha256:e6d8668fa5f93e706934a62d7b4db19c8d9eb8cf2adbb75ef1b675aa332b69da - # via gitdb snowballstemmer==2.2.0 \ --hash=sha256:09b16deb8547d3412ad7b590689584cd0fe25ec8db3be37788be3810cbf19cb1 \ --hash=sha256:c8e1716e83cc398ae16824e5572ae04e0d9fc2c6b985fb0f900f5f0c96ecba1a # via sphinx -sphinx==7.2.6 \ - --hash=sha256:1e09160a40b956dc623c910118fa636da93bd3ca0b9876a7b3df90f07d691560 \ - --hash=sha256:9a5160e1ea90688d5963ba09a2dcd8bdd526620edbb65c328728f1b2228d5ab5 +sphinx==7.3.7 \ + --hash=sha256:413f75440be4cacf328f580b4274ada4565fb2187d696a84970c23f77b64d8c3 \ + --hash=sha256:a4a7db75ed37531c05002d56ed6948d4c42f473a36f46e1382b0bd76ca9627bc # via # -r requirements.in # sphinx-rtd-theme @@ -702,9 +692,9 @@ sphinx==7.2.6 \ # sphinxcontrib-jquery # sphinxcontrib-qthelp # sphinxcontrib-serializinghtml -sphinx-rtd-theme==1.3.0 \ - --hash=sha256:46ddef89cc2416a81ecfbeaceab1881948c014b1b6e4450b815311a89fb977b0 \ - --hash=sha256:590b030c7abb9cf038ec053b95e5380b5c70d61591eb0b552063fbe7c41f0931 +sphinx-rtd-theme==2.0.0 \ + --hash=sha256:bd5d7b80622406762073a04ef8fadc5f9151261563d47027de09910ce03afe6b \ + --hash=sha256:ec93d0856dc280cf3aee9a4c9807c60e027c7f7b461b77aeffed682e68f0e586 # via -r requirements.in sphinxcontrib-applehelp==1.0.7 \ --hash=sha256:094c4d56209d1734e7d252f6e0b3ccc090bd52ee56807a5d9315b19c122ab15d \ @@ -749,9 +739,9 @@ urlwait==1.0 \ --hash=sha256:a9bf2da792fa6983fa93f6360108e16615066ab0f9cfb7f53e5faee5f5dffaac \ --hash=sha256:eae2c20001efc915166cac79c04bac0088ad5787ec64b36f27afd2f359953b2b # via -r requirements.in -werkzeug==3.0.1 \ - --hash=sha256:507e811ecea72b18a404947aded4b3390e1db8f826b494d76550ef45bb3b1dcc \ - --hash=sha256:90a285dc0e42ad56b34e696398b8122ee4c681833fb35b8334a095d82c56da10 +werkzeug==3.0.2 \ + --hash=sha256:3aac3f5da756f93030740bc235d3e09449efcf65f2f55e3602e1d851b8f48795 \ + --hash=sha256:e39b645a6ac92822588e7b39a692e7828724ceae0b0d702ef96701f90e70128d # via -r requirements.in wheel==0.41.3 \ --hash=sha256:488609bc63a29322326e05560731bf7bfea8e48ad646e1f5e40d366607de0942 \ diff --git a/systemtest/test_dockerflow.py b/systemtest/test_dockerflow.py index 35727247..829a5de5 100644 --- a/systemtest/test_dockerflow.py +++ b/systemtest/test_dockerflow.py @@ -17,9 +17,15 @@ def test_version(self, baseurl): data = resp.json() assert isinstance(data, dict) data_keys = list(sorted(data.keys())) - # It's empty in the local dev environment, but has 4 keys in the server + # It's got "cloud" in the local dev environment and 5 keys in a server # environment - assert data_keys == [] or data_keys == ["build", "commit", "source", "version"] + assert data_keys == ["cloud"] or data_keys == [ + "build", + "cloud", + "commit", + "source", + "version", + ] def test_heartbeat(self, baseurl): resp = requests.get(baseurl + "__heartbeat__", timeout=5) diff --git a/tests/unittest/test_health_resource.py b/tests/unittest/test_health_resource.py index a70c6553..c958c05d 100644 --- a/tests/unittest/test_health_resource.py +++ b/tests/unittest/test_health_resource.py @@ -2,6 +2,23 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at https://mozilla.org/MPL/2.0/. +from contextlib import contextmanager +import json +import os + + +@contextmanager +def gcs_crashstorage_envvar(): + # NOTE(willkg): we do this in a goofy way here because it means we don't actually + # have to set this in the environment which causes the app to fail at startup + # because the bucket doesn't exist + key = "CRASHMOVER_CRASHSTORAGE_CLASS" + os.environ[key] = "antenna.ext.gcs.crashstorage.GcsCrashStorage" + + yield + + del os.environ[key] + class TestHealthChecks: def test_no_version(self, client, tmpdir): @@ -10,9 +27,20 @@ def test_no_version(self, client, tmpdir): client.rebuild_app({"BASEDIR": str(tmpdir)}) result = client.simulate_get("/__version__") - assert result.content == b"{}" + version_info = {"cloud": "AWS"} + assert json.loads(result.content) == version_info + + def test_no_version_gcp(self, client, tmpdir): + # Set basedir here to tmpdir which we *know* doesn't have a + # version.json in it. + client.rebuild_app({"BASEDIR": str(tmpdir)}) + + with gcs_crashstorage_envvar(): + result = client.simulate_get("/__version__") + version_info = {"cloud": "GCP"} + assert json.loads(result.content) == version_info - def test_version(self, client, tmpdir): + def test_version_aws(self, client, tmpdir): client.rebuild_app({"BASEDIR": str(tmpdir)}) # NOTE(willkg): The actual version.json has other things in it, @@ -22,7 +50,22 @@ def test_version(self, client, tmpdir): version_path.write('{"commit": "ou812"}') result = client.simulate_get("/__version__") - assert result.content == b'{"commit": "ou812"}' + version_info = {"commit": "ou812", "cloud": "AWS"} + assert json.loads(result.content) == version_info + + def test_version_gcp(self, client, tmpdir): + client.rebuild_app({"BASEDIR": str(tmpdir)}) + + # NOTE(willkg): The actual version.json has other things in it, + # but our endpoint just spits out the file verbatim, so we + # can test with whatever. + version_path = tmpdir.join("/version.json") + version_path.write('{"commit": "ou812"}') + + with gcs_crashstorage_envvar(): + result = client.simulate_get("/__version__") + version_info = {"commit": "ou812", "cloud": "GCP"} + assert json.loads(result.content) == version_info def test_lb_heartbeat(self, client): resp = client.simulate_get("/__lbheartbeat__") diff --git a/tests/unittest/test_sentry.py b/tests/unittest/test_sentry.py index caff5ac3..39b89b72 100644 --- a/tests/unittest/test_sentry.py +++ b/tests/unittest/test_sentry.py @@ -97,7 +97,7 @@ "server_name": "", "timestamp": ANY, "transaction": "/__broken__", - "transaction_info": {}, + "transaction_info": {"source": "route"}, }