Skip to content

Comments

Remove v1 API support and transition to v2 exclusively#521

Merged
jrhoads merged 9 commits intodevfrom
refactor-remove-v1code
Feb 16, 2026
Merged

Remove v1 API support and transition to v2 exclusively#521
jrhoads merged 9 commits intodevfrom
refactor-remove-v1code

Conversation

@jrhoads
Copy link
Member

@jrhoads jrhoads commented Feb 16, 2026

Purpose

This PR officially removes support for the v1 API and schema, fully transitioning the ROR API to v2 as the exclusive version. This includes removing v1-specific models, serializers, index templates, and tests.

Approach

The codebase has been refactored to remove version-branching logic. Previously, many functions accepted a version parameter to toggle between v1 and v2 behavior; these have been simplified to default to v2 logic only. The Elasticsearch query builders and matching algorithms now exclusively target the organizations-v2 index and schema.

Key Modifications

  • API Versioning: Updated ALLOWED_VERSIONS in settings.py to ['v2'] and removed v1 from URL patterns.
  • Data Indexing: Updated README and setup commands to default to schema version 2 (-s 2).
  • Core Logic: Removed conditional logic in matching.py, queries.py, and views.py that handled v1 record structures (e.g., labels, aliases, country.country_code).
  • Deleted V1 Assets:
    • Removed rorapi/v1/ directory containing models, serializers, and Elasticsearch templates.
    • Removed V1DeprecationMiddleware and its associated settings.
  • Testing: Deleted all v1-specific functional, integration, and unit tests.

Important Technical Details

  • The organizations Elasticsearch index is no longer referenced; all queries now target organizations-v2.
  • Advanced query validation (ALLOWED_FIELDS_V2) now only permits fields present in the v2 schema.
  • The HeartbeatView and GenerateId services now exclusively validate against the v2 index.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Reviewer, please remember our guidelines:

  • Be humble in the language and feedback you give, ask don't tell.
  • Consider using positive language as opposed to neutral when offering feedback. This is to avoid the negative bias that can occur with neutral language appearing negative.
  • Offer suggestions on how to improve code e.g. simplification or expanding clarity.
  • Ensure you give reasons for the changes you are proposing.

]
)

sort_field = params.get("sort", "id")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sort removed because it is not used

@jrhoads jrhoads merged commit 4781d91 into dev Feb 16, 2026
2 checks passed
jrhoads added a commit that referenced this pull request Feb 17, 2026
[STAGING] Remove v1 API code and transition to v2 (#521)
jrhoads added a commit that referenced this pull request Feb 18, 2026
[PROD] Remove unused v1 API Code (#521) (#524)
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.

1 participant