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

Prepare release 2.36.0 #961

Merged
merged 53 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
9d4ef36
Bump pytest-cov from 4.1.0 to 5.0.0
dependabot[bot] Mar 25, 2024
bc4a2b1
Merge pull request #902 from sanger/dependabot/pip/pytest-cov-5.0.0
yoldas Mar 27, 2024
d918504
Bump idna from 3.6 to 3.7
dependabot[bot] Apr 12, 2024
aa6d4b4
Modifed workflow config to keep older stable images
SHIV5T3R Apr 12, 2024
d553d1e
Merge pull request #909 from sanger/y24-036-workflow-docker-rm-fix
SHIV5T3R Apr 15, 2024
7a90436
Bump gunicorn from 21.2.0 to 22.0.0
dependabot[bot] Apr 17, 2024
0a6e49d
Bump aiohttp from 3.9.2 to 3.9.4
dependabot[bot] Apr 18, 2024
11c969e
Bump black from 24.3.0 to 24.4.2
dependabot[bot] Apr 26, 2024
5788f20
Bump flake8-bugbear from 24.2.6 to 24.4.26
dependabot[bot] Apr 29, 2024
430171b
Merge pull request #918 from sanger/dependabot/pip/flake8-bugbear-24.…
yoldas Apr 30, 2024
71ec07c
Use v3 Codecov action in CI test workflow
sdjmchattie Apr 30, 2024
a8dfd9d
Merge pull request #919 from sanger/fix-codecov-action
sdjmchattie May 1, 2024
261e223
Bump werkzeug from 3.0.1 to 3.0.3
dependabot[bot] May 6, 2024
11a8461
Bump jinja2 from 3.1.3 to 3.1.4
dependabot[bot] May 6, 2024
16bb417
---
dependabot[bot] May 21, 2024
1ec7288
Create assign_issue_number.yml
SHIV5T3R May 30, 2024
f9d8a2c
Bump pytest from 8.1.1 to 8.2.2
dependabot[bot] Jun 5, 2024
87e6dd1
Create add_prs_to_tech_debt_project.yml to add dependency updates to …
seenanair Jun 6, 2024
68f990e
New line added at end of file
seenanair Jun 7, 2024
e650776
Merge pull request #941 from sanger/y24-066-add-to-project-github-action
seenanair Jun 7, 2024
c7c7f84
Bump flask-cors from 4.0.0 to 4.0.1
dependabot[bot] Jun 7, 2024
500825a
Merge pull request #937 from sanger/y24-115-auto-issue-gen
SHIV5T3R Jun 12, 2024
c7a3a23
Bump coverage from 7.4.4 to 7.5.4
dependabot[bot] Jun 24, 2024
b9c3e25
Bump types-requests from 2.31.0.20240311 to 2.32.0.20240622
dependabot[bot] Jun 24, 2024
13a0cea
Merge pull request #907 from sanger/dependabot/pip/idna-3.7
stevieing Jul 9, 2024
6889a37
Merge pull request #910 from sanger/dependabot/pip/gunicorn-22.0.0
stevieing Jul 9, 2024
463c4bb
Merge pull request #911 from sanger/dependabot/pip/aiohttp-3.9.4
stevieing Jul 9, 2024
374e7e8
---
dependabot[bot] Jul 9, 2024
521ec31
Merge pull request #917 from sanger/dependabot/pip/black-24.4.2
stevieing Jul 9, 2024
7c6fd42
Bump mypy from 1.9.0 to 1.10.1
dependabot[bot] Jul 9, 2024
38dd411
Merge pull request #924 from sanger/dependabot/pip/werkzeug-3.0.3
stevieing Jul 9, 2024
f48c2aa
Merge pull request #925 from sanger/dependabot/pip/jinja2-3.1.4
stevieing Jul 9, 2024
3d65164
Merge pull request #928 from sanger/dependabot/pip/requests-2.32.0
stevieing Jul 9, 2024
9b373c2
Bump urllib3 from 2.0.7 to 2.2.2
dependabot[bot] Jul 9, 2024
074fb67
Bump sqlalchemy from 2.0.28 to 2.0.31
dependabot[bot] Jul 9, 2024
a76d859
Bump pymongo from 4.6.2 to 4.8.0
dependabot[bot] Jul 9, 2024
8202d48
Merge pull request #931 from sanger/dependabot/pip/pymysql-1.1.1
stevieing Jul 9, 2024
b175e95
Bump requests from 2.31.0 to 2.32.3
dependabot[bot] Jul 9, 2024
14c56b6
Merge pull request #936 from sanger/dependabot/pip/requests-2.32.3
stevieing Jul 9, 2024
2321b9c
Merge pull request #939 from sanger/dependabot/pip/pytest-8.2.2
stevieing Jul 9, 2024
79a2604
Merge pull request #942 from sanger/dependabot/pip/flask-cors-4.0.1
stevieing Jul 9, 2024
e6cb2a7
Merge pull request #943 from sanger/dependabot/pip/urllib3-2.2.2
stevieing Jul 9, 2024
1591997
Merge pull request #944 from sanger/dependabot/pip/sqlalchemy-2.0.31
stevieing Jul 9, 2024
7ab7924
Merge pull request #945 from sanger/dependabot/pip/coverage-7.5.4
stevieing Jul 9, 2024
d9e6fc1
Merge pull request #946 from sanger/dependabot/pip/types-requests-2.3…
stevieing Jul 9, 2024
d8b722a
Merge pull request #947 from sanger/dependabot/pip/mypy-1.10.1
stevieing Jul 9, 2024
dcca1c9
Merge pull request #948 from sanger/dependabot/pip/pymongo-4.8.0
stevieing Jul 9, 2024
8a6d1e6
Remove obsolete version declaration in docker-compose.yml
sdjmchattie Jul 17, 2024
5af7f0e
Switch to using the built-in compose function of Docker
sdjmchattie Jul 17, 2024
1f8d843
Use authentication headers for all SS v2 requests
sdjmchattie Jul 17, 2024
efdd352
Allow linting of test file
sdjmchattie Jul 17, 2024
cf265af
Merge pull request #958 from sanger/Y24-191-add-api-keys-to-ss-requests
sdjmchattie Jul 19, 2024
549e6c8
Update release version to 2.36.0
sdjmchattie Jul 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/add_prs_to_tech_debt_project.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Calls a reusable workflow in the .github repo,
# which adds the PR that triggered this to the Technical Debt project board, if it is a depfu one.
# Passes the 'PSD-AddToProject' GitHub App key and App Id as secrets to the reusable workflow.

name: Add dependencies to technical debt project

on:
# Triggered on creation of pull requests with any label,
# or when a label is added to an existing pull request.
pull_request:
types:
- labeled

jobs:
call-workflow-add_to_technical_debt_project:
uses: sanger/.github/.github/workflows/add_to_tech_debt_project_reusable.yml@master
secrets:
app_id: ${{ secrets.ADD_TO_PROJECT_APP_ID_PSD }}
app_key: ${{ secrets.ADD_TO_PROJECT_APP_KEY_PSD }}
12 changes: 12 additions & 0 deletions .github/workflows/assign_issue_number.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Assign Issue Number

on:
issues:
types: [opened]

jobs:
call-add-to-project:
uses: sanger/.github/.github/workflows/generate_issue_number.yml@master
secrets:
app_id: ${{ secrets.ISSUE_GEN_APP_ID }}
app_key: ${{ secrets.ISSUE_GEN_APP_KEY }}
3 changes: 1 addition & 2 deletions .github/workflows/automated_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,5 @@ jobs:
account-type: org
org-name: sanger
keep-at-least: 5
skip-tags: latest
skip-tags: latest, *[!develop] # This will DELETE any images where the tag contains ANY characters in "develop", excluding '!'
token: ${{ secrets.REMOVE_OLD_IMAGES }}

4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,6 @@ jobs:
run: |
python -m pytest -x
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
2 changes: 1 addition & 1 deletion .release-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.35.1
2.36.0
6 changes: 3 additions & 3 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@ colorlog = "~=6.8"
eve = "~=2.1"
flask-apscheduler = "~=1.13"
flask-cors = "~=4.0"
gunicorn = "~=21.2"
gunicorn = "~=22.0"
openpyxl = "~=3.1"
pandas = "~=2.0"
pika = "~=1.3"
pymysql = "~=1.1"
pyodbc = "~=5.1"
python-dotenv = "~=1.0"
requests = "~=2.31"
requests = "~=2.32"
slackclient = "~=2.9"
sqlalchemy = "~=2.0"
pymongo = "~=4.6.2"
pymongo = "~=4.8.0"

[requires]
python_version = "3.8"
Expand Down
1,225 changes: 614 additions & 611 deletions Pipfile.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dependencies/down.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash

cd "$(dirname "$0")"
docker-compose down
docker compose down
2 changes: 1 addition & 1 deletion dependencies/up.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

cd "$(dirname "$0")"
docker-compose up -d
docker compose up -d

# Initialise the MongoDB replica set after 5 seconds
sleep 5
Expand Down
1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: "3.8"
services:
lighthouse:
build: .
Expand Down
7 changes: 5 additions & 2 deletions lighthouse/helpers/plates.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,10 +429,11 @@ def convert_json_response_into_dict(barcode: str, json) -> dict:

def get_from_ss_plates_samples_info(plate_barcode: str) -> requests.Response:
ss_url: str = f"{app.config['SS_URL']}/api/v2/labware"
headers = _ss_headers()

try:
params = {"filter[barcode]": plate_barcode, "include": "purpose,receptacles.aliquots.sample"}
response = requests.get(f"{ss_url}", params=params)
response = requests.get(f"{ss_url}", params=params, headers=headers)

LOGGER.debug(f"Response status code: {response.status_code}")

Expand Down Expand Up @@ -814,7 +815,9 @@ def plate_exists_in_ss_with_barcode(barcode: str) -> bool:
params = {
"filter[barcode]": barcode,
}
response = requests.get(f"{ss_url}/api/v2/labware", params=params)
headers = _ss_headers()

response = requests.get(f"{ss_url}/api/v2/labware", params=params, headers=headers)

LOGGER.debug(f"Response status code: {response.status_code}")

Expand Down
11 changes: 8 additions & 3 deletions tests/helpers/test_plates_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@

# ---------- test helpers ----------

SS_AUTH_HEADER_MATCHER = responses.matchers.header_matcher({"X-Sequencescape-Client-Id": "development"})


@pytest.fixture
def mock_event_helpers():
Expand Down Expand Up @@ -143,7 +145,7 @@ def test_get_from_ss_plates_samples_info_success(app, mocked_responses):
)
json = {"data": ["plate data"], "included": ["plate includes"]}

mocked_responses.add(responses.GET, ss_url, json=json, status=HTTPStatus.OK)
mocked_responses.add(responses.GET, ss_url, json=json, status=HTTPStatus.OK, match=[SS_AUTH_HEADER_MATCHER])

response = get_from_ss_plates_samples_info(barcode)
assert response.json() == json
Expand All @@ -163,7 +165,7 @@ def test_convert_json_response_into_dict():
assert data == {"data": {"barcode": barcode, "positive_control": "A1", "negative_control": "B1"}, "error": None}


def test_classify_samples_by_centre(app, samples, mocked_responses):
def test_classify_samples_by_centre(samples):
samples, _ = samples
assert list(classify_samples_by_centre(samples).keys()) == ["centre_1", "centre_2"]
assert len(classify_samples_by_centre(samples)["centre_1"]) == 11
Expand All @@ -177,7 +179,7 @@ def test_centre_prefixes_for_samples(samples):
assert actual == ["centre_1", "centre_2"]


def test_centre_prefix(app, centres, mocked_responses):
def test_centre_prefix(app, centres):
with app.app_context():
assert get_centre_prefix("CENTRE_1") == "TC1"
assert get_centre_prefix("centre_2") == "TC2"
Expand Down Expand Up @@ -1057,6 +1059,7 @@ def test_format_plate_destination(app, mocked_responses):
f"{ss_url}?{urllib.parse.quote('filter[barcode]')}={plate_barcode}",
json={"data": ["barcode exists!"]},
status=HTTPStatus.OK,
match=[SS_AUTH_HEADER_MATCHER],
)
response = {
"plate_barcode": "dest_123",
Expand Down Expand Up @@ -1095,12 +1098,14 @@ def test_plate_exists_in_ss_with_barcode(app, mocked_responses):
f"{ss_url}?{urllib.parse.quote('filter[barcode]')}={first_plate_barcode}",
json={"data": ["barcode exists!"]},
status=HTTPStatus.OK,
match=[SS_AUTH_HEADER_MATCHER],
)
mocked_responses.add(
responses.GET,
f"{ss_url}?{urllib.parse.quote('filter[barcode]')}={second_plate_barcode}",
json={"data": []},
status=HTTPStatus.OK,
match=[SS_AUTH_HEADER_MATCHER],
)

assert plate_exists_in_ss_with_barcode(barcode=first_plate_barcode) is True
Expand Down
Loading