cloudfoundry / cloudfoundry/cloud_controller_ng

List app features endpoint should not (pretend to) support pagination

Open
#4,701 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
207
Forks
373
Avg merge
2d 12h
Merged PRs (30d)
56

Description

Issue

The GET /v3/apps/:guid/features endpoint "pretends" to support pagination - it returns a pagination object. But neither per_page nor order_by are working. Also the first and last links are incorrect.

Context

No response

Steps to Reproduce

No response

Expected Result

With pagination removed:

{
  "resources": [
    {
      "name": "ssh",
      "description": "Enable SSHing into the app.",
      "enabled": true
    },
    {
      "name": "revisions",
      "description": "Enable versioning of an application",
      "enabled": true
    },
    {
      "name": "service-binding-k8s",
      "description": "Enable k8s service bindings for the app",
      "enabled": true
    },
    {
      "name": "file-based-vcap-services",
      "description": "Enable file-based VCAP service bindings for the app",
      "enabled": false
    }
  ]
}

With pagination removed and links added:

{
  "resources": [
    {
      "name": "ssh",
      "description": "Enable SSHing into the app.",
      "enabled": true
    },
    {
      "name": "revisions",
      "description": "Enable versioning of an application",
      "enabled": true
    },
    {
      "name": "service-binding-k8s",
      "description": "Enable k8s service bindings for the app",
      "enabled": true
    },
    {
      "name": "file-based-vcap-services",
      "description": "Enable file-based VCAP service bindings for the app",
      "enabled": false
    }
  ],
  "links": {
    "self": {
      "href": "https://api.example.org/v3/apps/b832f30f-bd3c-47a4-9192-1194835ef854/features"
    },
    "app": {
      "href": "https://api.example.org/v3/apps/b832f30f-bd3c-47a4-9192-1194835ef854"
    }
  }
}
Current Result
{
  "resources": [
    {
      "name": "ssh",
      "description": "Enable SSHing into the app.",
      "enabled": true
    },
    {
      "name": "revisions",
      "description": "Enable versioning of an application",
      "enabled": true
    },
    {
      "name": "service-binding-k8s",
      "description": "Enable k8s service bindings for the app",
      "enabled": true
    },
    {
      "name": "file-based-vcap-services",
      "description": "Enable file-based VCAP service bindings for the app",
      "enabled": false
    }
  ],
  "pagination": {
    "total_results": 4,
    "total_pages": 1,
    "first": {
      "href": "/v3/apps/b832f30f-bd3c-47a4-9192-1194835ef854/features"
    },
    "last": {
      "href": "/v3/apps/b832f30f-bd3c-47a4-9192-1194835ef854/features"
    },
    "next": null,
    "previous": null
  }
}
Possible Fix

I'm proposing to remove pagination from the response and maybe(?) add links instead (like it's done for GET /v3/apps/:guid/environment_variables).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the GET /v3/apps/:guid/features endpoint and locate its response and endpoint tests. Compare the current response with the examples in this issue, then verify that the finished behavior has no pagination object and has the expected app and self links if links are included.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.