Skip to content

feat(integrations): Azure DevOps resource-type and tag enums (PR 1/N)#7621

Draft
asaphko wants to merge 8 commits into
feat/azure-devops-specfrom
feat/azure-devops-01-resource-types
Draft

feat(integrations): Azure DevOps resource-type and tag enums (PR 1/N)#7621
asaphko wants to merge 8 commits into
feat/azure-devops-specfrom
feat/azure-devops-01-resource-types

Conversation

@asaphko
Copy link
Copy Markdown
Contributor

@asaphko asaphko commented May 28, 2026

Summary

PR 1 of the stacked Azure DevOps integration rollout. Foundational enum extensions only — no behaviour change, no new app code. Everything in this PR is referenced by subsequent PRs in the stack.

  • ResourceType.AZURE_DEVOPS_PULL_REQUEST and ResourceType.AZURE_DEVOPS_WORK_ITEM added to api/features/feature_external_resources/models.py, alongside an AZURE_DEVOPS_RESOURCE_TYPES tuple mirroring GITLAB_RESOURCE_TYPES.
  • FeatureExternalResource.type.max_length widened 20 → 30 to fit the new values (AZURE_DEVOPS_PULL_REQUEST is 25 chars). Metadata-only column change on Postgres.
  • TagType.AZURE_DEVOPS added to api/projects/tags/models.py.
  • Two hand-named migrations recording the new choices (0004_add_azure_resource_types.py, 0010_add_azure_devops_tag_type.py).
  • New pytest files with 8 micro-tests covering the new symbols and field-level regression guards.

Stack

This PR targets feat/azure-devops-spec (#7620). The spec PR should land first, then this branch can be retargeted at main.

Plan for this PR: docs/superpowers/plans/2026-05-28-azure-devops-01-resource-types.md.

Naming note

Resource type values use AZURE_DEVOPS_* (not bare AZURE_*) for consistency with TagType.AZURE_DEVOPS and to disambiguate from other Microsoft "Azure" products. Renaming after a migration ships is painful, so locking the name in this PR.

Test plan

  • make lint clean
  • make typecheck clean
  • make test opts='-n0 tests/unit/features/test_unit_feature_external_resources_models.py tests/unit/projects/tags/test_unit_projects_tags_models.py -v' — 8 passed
  • GitLab integration regression: make test opts='tests/unit/integrations/gitlab tests/unit/features/test_unit_feature_external_resources_views.py tests/unit/features/test_migrations.py' — all pass
  • manage.py makemigrations --check --dry-run feature_external_resources tagsNo changes detected

🤖 Generated with Claude Code

asaphko and others added 8 commits May 28, 2026 11:13
…gration

First plan in the stacked-PRs implementation of the Azure DevOps integration
spec. Covers the foundational enum extensions: AZURE_DEVOPS_PULL_REQUEST and
AZURE_DEVOPS_WORK_ITEM in ResourceType plus AZURE_DEVOPS in TagType, with
their migrations. No behaviour change; later PRs in the stack build on
these symbols.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Add AZURE_DEVOPS_PULL_REQUEST and AZURE_DEVOPS_WORK_ITEM to ResourceType
plus an AZURE_DEVOPS_RESOURCE_TYPES tuple for downstream use, mirroring
the existing GitLab pattern. Bumps the type column's max_length from 20
to 30 to fit the new value lengths.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
… spec

Align the design spec with TagType.AZURE_DEVOPS and the one-product-name-token
pattern the GitHub and GitLab integrations follow. The plan doc and the
source/test changes for this rename live in the two preceding commits.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…vOps choices

Add migration recording AZURE_DEVOPS_PULL_REQUEST and
AZURE_DEVOPS_WORK_ITEM in the choices list for the type column, and
widening max_length from 20 to 30 to fit the longest new value.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Add the AZURE_DEVOPS TagType so the Azure DevOps integration can tag
features with system tags reflecting upstream PR / work-item state in
later PRs.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Add migration recording AZURE_DEVOPS in the choices list for Tag.type.
No column shape change.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The flagsmith-lint-tests pre-commit hook requires "# Given", "# When",
and "# Then" as three separate marker lines in every test. The Azure
DevOps PR-1 micro-tests originally used the combined "# Given / When /
Then" shorthand for trivial one-assert cases; split them into proper
three-phase structure and accept the accompanying ruff format change.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The cleanup in d752544 missed one site where the test body still
used "# Given / When". Split it into proper three-marker form to match
the rest of the file.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 28, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

3 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs Ignored Ignored May 28, 2026 10:51am
flagsmith-frontend-preview Ignored Ignored May 28, 2026 10:51am
flagsmith-frontend-staging Ignored Ignored May 28, 2026 10:51am

Request Review

@github-actions github-actions Bot added api Issue related to the REST API docs Documentation updates labels May 28, 2026
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces foundational changes for the Azure DevOps integration. It adds the AZURE_DEVOPS_PULL_REQUEST and AZURE_DEVOPS_WORK_ITEM resource types to ResourceType, increases the maximum length of the resource type field, and adds AZURE_DEVOPS to TagType. It also includes the corresponding Django database migrations, unit tests, and updates to the integration plan and design specifications. There are no review comments to address, and the changes look solid and well-tested.

@github-actions github-actions Bot added feature New feature or request and removed docs Documentation updates labels May 28, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (feat/azure-devops-spec@47eccb7). Learn more about missing BASE report.

Additional details and impacted files
@@                    Coverage Diff                    @@
##             feat/azure-devops-spec    #7621   +/-   ##
=========================================================
  Coverage                          ?   98.52%           
=========================================================
  Files                             ?     1443           
  Lines                             ?    54803           
  Branches                          ?        0           
=========================================================
  Hits                              ?    53993           
  Misses                            ?      810           
  Partials                          ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api Issue related to the REST API feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant