Skip to content

Upstream changes#1

Merged
Rub21 merged 38 commits intoohmfrom
upstream_main
May 14, 2025
Merged

Upstream changes#1
Rub21 merged 38 commits intoohmfrom
upstream_main

Conversation

@Rub21
Copy link
Copy Markdown
Member

@Rub21 Rub21 commented Jan 29, 2025

No description provided.

willemarcel and others added 30 commits March 27, 2024 13:18
* Set backfill_changesets default behaviour to backfill the last day changesets

* Fix test command arguments

* Fix typo

* Fix start_date and end_date access
Bumps [sqlparse](https://github.com/andialbrecht/sqlparse) from 0.4.2 to 0.4.4.
- [Changelog](https://github.com/andialbrecht/sqlparse/blob/master/CHANGELOG)
- [Commits](andialbrecht/sqlparse@0.4.2...0.4.4)

---
updated-dependencies:
- dependency-name: sqlparse
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Switch to oauth2 authentication

* Update ChangesetCommentAPI to use oauth2

* FIx comment api tests

* Update social-user's extra_data param in tests

* Update tests to oauth2 fields

* Fix client.post and token check
* Update DRF-gis to 1.0

* Remove celery

* Remove BROKER_URL from config
* Set user-agent when making requests to the OSM API

* Add header to test mock

* Fix get display_name

* Fix error in users.tests.test_utils
This allows us to monitor the API health more easily from a remote
service such as updown.io.
)

Followup on commit 2991254 which removed the management commands
necessary for serving the frontend via Django. The supported workflow
is now to deploy the frontend separately and configure it to talk
to this Django app. If desired, both can be served by an Nginx proxy
(which serves static files for the frontend and proxies /api requests
to Django).
This brings the local dev environment closer to production by using
the same frontend container. It also changes the backend to serve with
gunicorn by default, even in dev mode. Also, static files are now always
served by the frontend and never by Django, even in dev mode.
* Update views.py

* Update test_changeset_views.py
Rub21 and others added 8 commits January 31, 2025 13:10
This endpoint recieves a large volume of requests (one for each new changeset)
from a single admin user account. Rate-limiting it will cause tag-changes data
to stop being ingested during periods when there are lots of edits happening
in OSM, which isn't desirable.
The DRF Serializer for the Changeset model was using obj.tags.filter()
and obj.reasons.filter() to filter the lists of reasons and tags
(only showing enabled ones to non-staff users). This had the probably
unexpected consequence of generating an additional two database
queries for each changeset in the resulting list. The reasons and tags
related fields were being prefetched, but prefetching only works for
iterating the entire relation.

The fix for this problem is straightforward: instead of using .filter(),
we can just filter the reasons and tags in Python. This allows the
prefetching to work as intended and avoids the additional queries.
@Rub21 Rub21 merged commit a851306 into ohm May 14, 2025
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants