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

feat: include archived features as a filter option for the /api/admin/projects/*/features endpoint #8007

Open
kim-anchorzero opened this issue Aug 28, 2024 · 1 comment
Labels
feature request A wish for Unleash to do something it doesn't already do.

Comments

@kim-anchorzero
Copy link

Describe the bug

The documentation for this endpoint (https://docs.getunleash.io/reference/api/unleash/get-features) suggests that archived features will be returned (by virtue of the archived/archivedAt attributes) but these are omitted from results.

Steps to reproduce the bug

  • from the admin ui add a feature test in default project
  • execute request for /api/admin/projects/default/features
  • note the feature is there
  • from the admin ui archive the test feature
  • execute request for /api/admin/projects/default/features
  • note that you get no features returned

Expected behavior

Archived features are returned with the appropriate attributes.

Logs, error output, etc.

When feature is not archived:

{
  "version": 2,
  "features": [
    {
      "type": "release",
      "description": null,
      "name": "test",
      "createdAt": "2024-08-14T16:48:55.487Z",
      "stale": false,
      "impressionData": false,
      "lastSeenAt": null,
      "environments": [
        {
          "name": "development",
          "enabled": false,
          "type": "development",
          "sortOrder": 2,
          "variantCount": 0,
          "lastSeenAt": null,
          "hasStrategies": false,
          "hasEnabledStrategies": false
        },
        {
          "name": "production",
          "enabled": false,
          "type": "production",
          "sortOrder": 3,
          "variantCount": 0,
          "lastSeenAt": null,
          "hasStrategies": false,
          "hasEnabledStrategies": false
        }
      ]
    }
  ]
}


after it's archived:
```json
{
  "version": 2,
  "features": []
}


### Screenshots

_No response_

### Additional context

_No response_

### Unleash version

6.1.12

### Subscription type

None

### Hosting type

Self-hosted

### SDK information (language and version)

_No response_
@ivarconr
Copy link
Member

Hi @kim-anchorzero,

this is not how Unleash works today, but a direction we want to move Unleash.

Currently you need to use this endpoint to fetched archived falgs:
https://docs.getunleash.io/reference/api/unleash/get-archived-features-by-project-id

Soon we want consolidate this in to the project features endpoint, this is why the archive-endpoint is marked as deprecated and why you can see hints on archive details for this endpoint.

@ivarconr ivarconr changed the title archived features are not returned via /api/admin/projects/*/features feat:; include archived features as a filter option for the /api/admin/projects/*/features endpoint Aug 29, 2024
@ivarconr ivarconr added feature request A wish for Unleash to do something it doesn't already do. and removed bug labels Aug 29, 2024
@ivarconr ivarconr changed the title feat:; include archived features as a filter option for the /api/admin/projects/*/features endpoint feat: include archived features as a filter option for the /api/admin/projects/*/features endpoint Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request A wish for Unleash to do something it doesn't already do.
Projects
Status: Todo
Development

No branches or pull requests

2 participants