Skip to content

[Fleet] Rework "Dry Run" package policy upgrade logic into its own endpoint #115570

Description

@kpollich

Context: #114914 (comment)

We should make a clear distinction between the mutative upgrade operation and the read-only dry run operation for package policy upgrades by supporting two different HTTP verbs for these API calls.

The existing POST /package-policy/<id>/upgrade endpoint should remain the same, and will serve the purpose of upgrading a package policy to the latest installed version of its package. It does not support edits to the policy.

We should create a new GET /package-policy/<id>/upgrade endpoint that fulfills the same contract as the existing workflow around the request:

POST /package-policy/<id>/upgrade

{ 
  "dryRun": true
}

Activity

  1. elasticmachine commented on Oct 19, 2021

    @elasticmachine
    Contributor

    Pinging @elastic/fleet (Team:Fleet)

  2. self-assigned this
    on Nov 15, 2021
  3. criamico commented on Nov 16, 2021

    @criamico
    Member

    The upgrade endpoint has actually this format:

    POST /package_policies/upgrade
    {
      packagePolicyIds: [...],
      dryRun: false
    }
    

    After a discussion with @kpollich we determined that a better solution would be to split it in two POST endpoints, similar to what we already have:

    POST /package_policies/upgrade
    {
      packagePolicyIds: [...]
    }
    
    POST /package_policies/upgrade/dry_run
    {
      packagePolicyIds: [...]
    }
    

    This way we can keep passing an array of ids through the body, which is necessary as we run a "bulk" dry run in the "automatic package policy upgrade" modal on the integration settings page.

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

Metadata

Metadata

Assignees

Labels

Team:Fleet - DEPRECATEDUse Team:streams-uitechnical debtImprovement of the software architecture and operational architecture

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions