Skip to content

Release 0.28.0 #1978

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

Merged
merged 15 commits into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- 5432:5432

redis:
image: redis:7.4.1
image: redis:7.4.2
ports:
- 6379:6379

Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ repos:
html,
]
- repo: https://github.com/scop/pre-commit-shfmt
rev: v3.10.0-1
rev: v3.10.0-2
hooks:
- id: shfmt
- repo: https://github.com/adrienverge/yamllint.git
Expand Down Expand Up @@ -74,7 +74,7 @@ repos:
- ".*/generated/"
additional_dependencies: ["gibberish-detector"]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.7.2"
rev: "v0.9.1"
hooks:
- id: ruff-format
- id: ruff
Expand Down
17 changes: 17 additions & 0 deletions RELEASE.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
Release Notes
=============

Version 0.28.0
--------------

- remove two unused entries (#1977)
- Update dependency litellm to v1.59.0 (#1972)
- Update dependency ruff to v0.9.2 (#1973)
- Update dependency bpython to ^0.25 (#1971)
- Update Node.js to v22.13.0 (#1970)
- Update redis Docker tag to v7.4.2 (#1969)
- [pre-commit.ci] pre-commit autoupdate (#1820)
- fix line clamping of HTML description (#1967)
- Onboarding Accessibility Improvements (#1960)
- add proper mocking in drawer v2 tests handling items queries if resource is a program (#1965)
- add "courses in program" carousel (#1964)
- Update dependency @storybook/addon-webpack5-compiler-swc to v2 (#1942)
- Update dependency Django to v4.2.18 [SECURITY] (#1963)

Version 0.27.0 (Released January 16, 2025)
--------------

Expand Down
4 changes: 2 additions & 2 deletions ai_chat/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ class ChatMessageFactory(factory.Factory):

role = FuzzyChoice(MessageRole.USER, MessageRole.ASSISTANT)
content = factory.Faker("sentence")
id = name = factory.Sequence(lambda n: "%d" % n)
index = factory.Sequence(lambda n: "%d" % n)
id = name = factory.Sequence(lambda n: str(n))
index = factory.Sequence(lambda n: str(n))

class Meta:
model = ChatMessage
2 changes: 1 addition & 1 deletion authentication/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def process_exception(self, request, exception):

if url:
url += (
"?" in url and "&" or "?"
("?" in url and "&") or "?"
) + f"message={quote(message)}&backend={backend_name}"
return redirect(url)
return None
Expand Down
2 changes: 1 addition & 1 deletion channels/serializers_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def test_create_channel(base_channel_data, channel_detail, channel_type):
"""
paths = sorted(
(p.learning_resource for p in LearningPathFactory.create_batch(2)),
key=lambda list: list.id, # noqa: A002
key=lambda lst: lst.id,
reverse=True,
)

Expand Down
2 changes: 1 addition & 1 deletion conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@


@pytest.fixture(autouse=True)
def prevent_requests(mocker, request): # noqa: PT004
def prevent_requests(mocker, request):
"""Patch requests to error on request by default"""
if "mocked_responses" in request.fixturenames:
return
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.apps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ services:
profiles:
- frontend
working_dir: /src
image: node:22.12
image: node:22.13
entrypoint: ["/bin/sh", "-c"]
command:
- |
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ services:
redis:
profiles:
- backend
image: redis:7.4.1
image: redis:7.4.2
healthcheck:
test: ["CMD", "redis-cli", "ping", "|", "grep", "PONG"]
interval: 3s
Expand Down
4 changes: 2 additions & 2 deletions fixtures/aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@


@pytest.fixture(autouse=True)
def silence_s3_logging(): # noqa: PT004
def silence_s3_logging():
"""Only show S3 errors"""
logging.getLogger("botocore").setLevel(logging.ERROR)


@pytest.fixture
def mock_s3_fixture(): # noqa: PT004
def mock_s3_fixture():
"""Mock the S3 fixture for the duration of the test"""
with mock_aws():
yield
Expand Down
8 changes: 4 additions & 4 deletions fixtures/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@


@pytest.fixture(autouse=True)
def silence_factory_logging(): # noqa: PT004
def silence_factory_logging():
"""Only show factory errors"""
logging.getLogger("factory").setLevel(logging.ERROR)


@pytest.fixture(autouse=True)
def warnings_as_errors(): # noqa: PT004
def warnings_as_errors():
"""
Convert warnings to errors. This should only affect unit tests, letting pylint and other plugins
raise DeprecationWarnings without erroring.
Expand All @@ -53,7 +53,7 @@ def warnings_as_errors(): # noqa: PT004


@pytest.fixture
def randomness(): # noqa: PT004
def randomness():
"""Ensure a fixed seed for factoryboy"""
factory.fuzzy.reseed_random("happy little clouds")

Expand Down Expand Up @@ -95,7 +95,7 @@ def mocked_responses():


@pytest.fixture
def offeror_featured_lists(): # noqa: PT004
def offeror_featured_lists():
"""Generate featured offeror lists for testing"""
for offered_by in OfferedBy.names():
offeror = LearningResourceOfferorFactory.create(code=offered_by)
Expand Down
26 changes: 25 additions & 1 deletion frontends/api/src/hooks/learningResources/keyFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
schoolsApi,
featuredApi,
} from "../../clients"
import axiosInstance from "../../axios"
import type {
LearningResource,
LearningResourcesApiLearningResourcesListRequest as LearningResourcesListRequest,
Expand All @@ -16,6 +17,8 @@ import type {
OfferorsApiOfferorsListRequest,
PlatformsApiPlatformsListRequest,
FeaturedApiFeaturedListRequest as FeaturedListParams,
LearningResourcesApiLearningResourcesItemsListRequest as ItemsListRequest,
PaginatedLearningResourceRelationshipList,
} from "../../generated/v1"

const shuffle = ([...arr]) => {
Expand Down Expand Up @@ -63,13 +66,34 @@ export const clearListMemberships = (resource: LearningResource) => ({

const learningResources = createQueryKeys("learningResources", {
detail: (id: number) => ({
queryKey: [id],
queryKey: ["detail", id],
queryFn: async () => {
const { data } = await learningResourcesApi.learningResourcesRetrieve({
id,
})
return clearListMemberships(data)
},
contextQueries: {
items: (itemsP: ItemsListRequest) => ({
queryKey: [itemsP],
queryFn: async ({ pageParam }: { pageParam?: string } = {}) => {
// Use generated API for first request, then use next parameter
const request = pageParam
? axiosInstance.request<PaginatedLearningResourceRelationshipList>({
method: "get",
url: pageParam,
})
: learningResourcesApi.learningResourcesItemsList(itemsP)
const { data } = await request
return {
...data,
results: data.results.map((relation) => ({
...clearListMemberships(relation.resource),
})),
}
},
}),
},
}),
list: (params: LearningResourcesListRequest) => ({
queryKey: [params],
Expand Down
2 changes: 2 additions & 0 deletions frontends/api/src/test-utils/urls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ const learningResources = {
`${API_BASE_URL}/api/v1/learning_resources/${query(params)}`,
details: (params: Params<LRApi, "learningResourcesRetrieve">) =>
`${API_BASE_URL}/api/v1/learning_resources/${params.id}/`,
items: (params: Params<LRApi, "learningResourcesRetrieve">) =>
`${API_BASE_URL}/api/v1/learning_resources/${params.id}/items/`,
featured: (params?: Params<FeaturedApi, "featuredList">) =>
`${API_BASE_URL}/api/v1/featured/${query(params)}`,
similar: (params: Params<LRApi, "learningResourcesSimilarList">) =>
Expand Down
Loading
Loading