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

[API design] Patch software: install if host is below the current version #27031

Open
wants to merge 5 commits into
base: docs-v4.67.0
Choose a base branch
from

Conversation

noahtalerman
Copy link
Member

@noahtalerman noahtalerman commented Mar 11, 2025

@@ -9844,6 +9750,129 @@ Only one of `labels_include_any` or `labels_exclude_any` can be specified. If ne
}
```

### Patch software
Copy link
Member Author

@noahtalerman noahtalerman Mar 11, 2025

Choose a reason for hiding this comment

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

Dev note

Show this easy to understand error message if the software title has no software available for install:

Couldn't patch. Software doesn't have software available for install. Please add software.

Copy link
Member Author

Choose a reason for hiding this comment

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

Dev note

Show this error message if the minimum version isn't a semantic version with numbers only:

Can't patch. minimum_version must be a semantic version with numbers only (e.g. "6", "2.1", "1.0.0", or "7.8.53.43"): https://semver.org/

{}
```

### Install software
Copy link
Member Author

@noahtalerman noahtalerman Mar 11, 2025

Choose a reason for hiding this comment

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

Dev note

Show this easy to understand error message if the software title has no software available for install:

Couldn't install. Software doesn't have software available for install. Please add software.

{}
```

### Modify self-service
Copy link
Member Author

@noahtalerman noahtalerman Mar 11, 2025

Choose a reason for hiding this comment

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

Dev note

Show this easy to understand error message if the software title has no software available for install:

Couldn't edit self-service. Software doesn't have software available for install. Please add software.

@noahtalerman noahtalerman marked this pull request as draft March 11, 2025 15:29
@@ -8886,12 +8940,20 @@ Get a list of all software.
"name": "FirefoxInsall.pkg",
"version": "125.6",
"self_service": true,
"automatic_install_policies": [
"custom_policies": [
Copy link
Member Author

Choose a reason for hiding this comment

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

Dev note

Rename automatic_install_policies to custom_policies. We won't support old name for backwards compatibility because this endpoint is tagged as experimental: https://fleetdm.com/handbook/company/product-groups#experimental-features

Comment on lines +8949 to +8955
"patch_policy": {
"id": 343,
"name": "Patch Firefox.app",
},
"install_policy": {
"id": 343,
"name": "Install Firefox.app",
Copy link
Member Author

Choose a reason for hiding this comment

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

Dev note

New patch_policy and install_policy items to show different icons on the Software page.

"id": 345,
"name": "[Install software] Logic Pro",
}
"custom_policies": [
Copy link
Member Author

Choose a reason for hiding this comment

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

Dev note

Rename automatic_install_policies to custom_policies. We won't support old name for backwards compatibility because this endpoint is tagged as experimental: https://fleetdm.com/handbook/company/product-groups#experimental-features

Comment on lines -9405 to -9392
| self_service | boolean | form | Self-service software is optional and can be installed by the end user. |
| labels_include_any | array | form | Target hosts that have any label in the array. |
| labels_exclude_any | array | form | Target hosts that don't have any label in the array. |
| automatic_install | boolean | form | Automatically create policy that triggers install if software isn't installed on the host. |

Only one of `labels_include_any` or `labels_exclude_any` can be specified. If neither are specified, all hosts are targeted.
Copy link
Member Author

@noahtalerman noahtalerman Mar 12, 2025

Choose a reason for hiding this comment

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

Dev note

Remove self_service, automatic_install, and label_s flags because these are now handled by the new "Install software" API endpoint: https://github.com/fleetdm/fleet/pull/27031/files#diff-7246bc304b15c8865ed8eaa205e9c244d0a0314e4bae60cf553dc06147c38b64R9853

We won't support these for backwards compatibility because this endpoint is tagged as experimental: https://fleetdm.com/handbook/company/product-groups#experimental-features

Comment on lines -9472 to -9458
| self_service | boolean | form | Whether this is optional self-service software that can be installed by the end user. |
| labels_include_any | array | form | Target hosts that have any label in the array. Only one of either `labels_include_any` or `labels_exclude_any` can be specified. |
| labels_exclude_any | array | form | Target hosts that don't have any label in the array. |

Only one of `labels_include_any` or `labels_exclude_any` can be specified. If neither are specified, all hosts are targeted.
Copy link
Member Author

Choose a reason for hiding this comment

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

Dev note

Remove self_service, automatic_install, and label_s flags because these are now handled by the new "Install software" API endpoint: https://github.com/fleetdm/fleet/pull/27031/files#diff-7246bc304b15c8865ed8eaa205e9c244d0a0314e4bae60cf553dc06147c38b64R9853

We won't support these for backwards compatibility because this endpoint is tagged as experimental: https://fleetdm.com/handbook/company/product-groups#experimental-features

@@ -9632,81 +9681,6 @@ Only one of `labels_include_any` or `labels_exclude_any` can be specified. If ne
`Status: 200`


### Modify App Store app
Copy link
Member Author

Choose a reason for hiding this comment

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

Dev note

Remove this API endpoint because these options are now handled by the new "Install software" API endpoint: https://github.com/fleetdm/fleet/pull/27031/files#diff-7246bc304b15c8865ed8eaa205e9c244d0a0314e4bae60cf553dc06147c38b64R9853

We won't support these for backwards compatibility because this endpoint is tagged as experimental: https://fleetdm.com/handbook/company/product-groups#experimental-features

Comment on lines -9818 to -9804
| self_service | boolean | body | Self-service software is optional and can be installed by the end user. |
| labels_include_any | array | form | Target hosts that have any label in the array. |
| labels_exclude_any | array | form | Target hosts that don't have any label in the array. |

Only one of `labels_include_any` or `labels_exclude_any` can be specified. If neither are specified, all hosts are targeted.
Copy link
Member Author

Choose a reason for hiding this comment

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

Dev note

Remove self_service, automatic_install, and label_s flags because these are now handled by the new "Install software" API endpoint: https://github.com/fleetdm/fleet/pull/27031/files#diff-7246bc304b15c8865ed8eaa205e9c244d0a0314e4bae60cf553dc06147c38b64R9853

We won't support these for backwards compatibility because this endpoint is tagged as experimental: https://fleetdm.com/handbook/company/product-groups#experimental-features

@noahtalerman noahtalerman changed the title [API design] Patch software: install if host is below minimum version [API design] Patch software: install if host is below the current version Mar 12, 2025
@noahtalerman noahtalerman marked this pull request as ready for review March 12, 2025 14:58
@noahtalerman noahtalerman added the ~api-or-yaml-design Used for pull requests (PRs) with proposed API and YAML changes label Mar 12, 2025
@noahtalerman
Copy link
Member Author

@rachaelshaw just a heads up that this API design PR is now ready for review.

cc @eugkuo

"author_name": "Fleet",
"author_email": "",
"team_id": 274,
"fleet_maintained": true,
Copy link
Member Author

Choose a reason for hiding this comment

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

Dev note

New fleet_maintained flag. Currently will only be true for patch and install policies.

If true, the policy's name is "Fleet". author_id is null and author_email is an empty string.

Copy link
Member Author

Choose a reason for hiding this comment

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

Dev note

Can't delete fleet_maintained policies.

If the user tries to delete the policy via the Remove policies (global) or Remove team policies API endpoints, show this error with the fleet_created policy ID (first if there are multiple). None of the policies listed in the request are deleted:

Can't delete policies. Policy with ID 3 is a Fleet-maintained policy. Fleet-maintained policies can't be deleted.

If the user tries to edit the policy via the Edit policy (global) or Edit team policy API endpoints, show this error:

Can't edit Fleet-maintained policies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
~api-or-yaml-design Used for pull requests (PRs) with proposed API and YAML changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants