Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## Unreleased

- Document repository deprecation in README, gemspec metadata, and [RELEASE.md](RELEASE.md).

## Version 3.22.0

- #332 - @vnegi-digitalocean - add reserved ipv6 support
Expand Down
21 changes: 14 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
# DropletKit

> **Deprecated:** DropletKit is no longer actively maintained. New applications should use the [DigitalOcean API](https://docs.digitalocean.com/reference/api/) directly or a [supported SDK](https://docs.digitalocean.com/reference/libraries/) (TypeScript, Go, or Python). There is no official Ruby SDK.

[![Build Status](https://github.com/digitalocean/droplet_kit/workflows/CI/badge.svg?branch=main)](https://github.com/digitalocean/droplet_kit/actions)
[![Gem Version](https://badge.fury.io/rb/droplet_kit.svg)](https://badge.fury.io/rb/droplet_kit)

DropletKit is the official [DigitalOcean V2 API](https://developers.digitalocean.com/v2/) client. It supports everything the API can do with a simple interface written in Ruby.
DropletKit is a Ruby client for the [DigitalOcean V2 API](https://developers.digitalocean.com/v2/). It provides resource-oriented access to API endpoints. Existing apps may continue to use published gem versions; new API features will not be added here.

## Deprecation

- **Status:** Deprecated; no new features or API coverage. Critical security fixes only.
- **RubyGems:** Published versions remain available; no new releases are planned.
- **Migration:** Call the [API reference](https://docs.digitalocean.com/reference/api/) directly, or use [Godo](https://github.com/digitalocean/godo), [PyDo](https://github.com/digitalocean/pydo), or [DoTs](https://github.com/digitalocean/dots) from another language or service.
- **Forks:** Permitted under the [MIT license](LICENSE.txt).

## Installation

Expand Down Expand Up @@ -725,11 +735,8 @@ Actions supported:

## Contributing

1. Fork it ( https://github.com/digitalocean/droplet_kit/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request
This repository is deprecated and not accepting new features or API endpoint coverage. Critical security fixes may be considered on a case-by-case basis; open an issue before submitting a pull request.

## Releasing
See [RELEASE](RELEASE.md) for details

New gem releases are not planned. See [RELEASE](RELEASE.md) for the historical release process.
36 changes: 19 additions & 17 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
## Releasing
# Releasing

Once the changes have been merged to main it's time to release a new
version of the gem.
> **Note:** DropletKit is deprecated (see [README](README.md)). **No new gem releases are planned.** This document is kept for maintainers handling historical releases or a final deprecation notice release.

1. Creating a PR with a semantic version bump to
[version](https://github.com/digitalocean/droplet_kit/blob/main/lib/droplet_kit/version.rb)
and all the changes being released added to the
[CHANGELOG](https://github.com/digitalocean/droplet_kit/blob/main/CHANGELOG.md).
1. After the PR has been merged, create a release on GitHub for the new version:
- The tag should be in the format of: vX.Y.Z
- You can think of X.Y.Z as such:
X = breaking
Y = feature
Z = bugfix
- The title should be in the format of: vX.Y.Z (same as tag)
- The description should include all the changes being released in the format of:
- #[PR #] - @[contributor] - [description]
1. When the tag is created, a GitHub Actions workflow will publish the release to rubygems.
## Historical process

Once changes were merged to `main`, a new gem version was released as follows:

1. Create a PR with a semantic version bump to
[version](https://github.com/digitalocean/droplet_kit/blob/main/lib/droplet_kit/version.rb)
and all changes being released added to the
[CHANGELOG](https://github.com/digitalocean/droplet_kit/blob/main/CHANGELOG.md).
2. After the PR was merged, create a release on GitHub for the new version:
- Tag format: `vX.Y.Z`
- Version semantics: `X` = breaking, `Y` = feature, `Z` = bugfix
- Release description: `#[PR #] - @[contributor] - [description]`
3. When the tag was created, a GitHub Actions workflow published the release to RubyGems.

## Deprecation

If a final gem release is published to surface the `post_install_message` in `droplet_kit.gemspec`, follow the steps above with a patch version bump and a CHANGELOG entry documenting the deprecation notice.
10 changes: 8 additions & 2 deletions droplet_kit.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,14 @@ Gem::Specification.new do |spec|
spec.version = DropletKit::VERSION
spec.authors = ['DigitalOcean API Engineering team']
spec.email = ['api-engineering@digitalocean.com']
spec.summary = "Droplet Kit is the official Ruby library for DigitalOcean's API"
spec.description = "Droplet Kit is the official Ruby library for DigitalOcean's API"
spec.summary = '[DEPRECATED] Ruby client for the DigitalOcean API v2'
spec.description = 'DropletKit is deprecated and no longer actively maintained. See https://github.com/digitalocean/droplet_kit and https://docs.digitalocean.com/reference/libraries/'
spec.post_install_message = <<~MSG

DropletKit is deprecated and no longer actively maintained by DigitalOcean.
See https://docs.digitalocean.com/reference/libraries/ for supported SDKs.

MSG
spec.homepage = 'https://github.com/digitalocean/droplet_kit'
spec.license = 'MIT'

Expand Down
15 changes: 11 additions & 4 deletions lib/droplet_kit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -311,10 +311,17 @@ module DropletKit

# Errors
autoload :ErrorMapping, 'droplet_kit/mappings/error_mapping'
Error = Class.new(StandardError)
FailedCreate = Class.new(DropletKit::Error)
FailedUpdate = Class.new(DropletKit::Error)
FailedDelete = Class.new(DropletKit::Error)
class Error < StandardError
end

class FailedCreate < Error
end

class FailedUpdate < Error
end

class FailedDelete < Error
end
Comment thread
kishlay-singh-DO marked this conversation as resolved.
Outdated

class RateLimitReached < DropletKit::Error
attr_accessor :reset_at
Expand Down
1 change: 1 addition & 0 deletions lib/droplet_kit/mappings/container_registry_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
module DropletKit
class ContainerRegistryMapping
include Kartograph::DSL

kartograph do
mapping ContainerRegistry
root_key singular: 'registry', scopes: [:read]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
module DropletKit
class ContainerRegistryRepositoryMapping
include Kartograph::DSL

kartograph do
mapping ContainerRegistryRepository
root_key singular: 'repository', plural: 'repositories', scopes: [:read]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
module DropletKit
class ContainerRegistryRepositoryTagMapping
include Kartograph::DSL

kartograph do
mapping ContainerRegistryRepositoryTag
root_key singular: 'tag', plural: 'tags', scopes: [:read]
Expand Down
2 changes: 2 additions & 0 deletions lib/droplet_kit/mappings/database_postgres_config_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
module DropletKit
class DatabasePostgresPgbouncerConfigMapping
include Kartograph::DSL

kartograph do
mapping DatabasePostgresPgbouncerConfig

Expand All @@ -22,6 +23,7 @@ class DatabasePostgresPgbouncerConfigMapping

class DatabasePostgresTimescaledbConfigMapping
include Kartograph::DSL

kartograph do
mapping DatabasePostgresTimescaledbConfig
property :max_background_workers, scopes: %i[read update]
Expand Down
1 change: 1 addition & 0 deletions lib/droplet_kit/mappings/kubernetes_cluster_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
module DropletKit
class KubernetesClusterMapping
include Kartograph::DSL

kartograph do
mapping KubernetesCluster
root_key plural: 'kubernetes_clusters', singular: 'kubernetes_cluster', scopes: [:read]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
module DropletKit
class KubernetesMaintenancePolicyMapping
include Kartograph::DSL

kartograph do
mapping KubernetesMaintenancePolicyMapping

Expand Down
1 change: 1 addition & 0 deletions lib/droplet_kit/mappings/kubernetes_node_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
module DropletKit
class KubernetesNodeMapping
include Kartograph::DSL

kartograph do
mapping KubernetesNode

Expand Down
1 change: 1 addition & 0 deletions lib/droplet_kit/mappings/kubernetes_node_pool_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
module DropletKit
class KubernetesNodePoolMapping
include Kartograph::DSL

kartograph do
mapping KubernetesNodePool
root_key plural: 'node_pools', singular: 'node_pool', scopes: [:read]
Expand Down
1 change: 1 addition & 0 deletions lib/droplet_kit/mappings/kubernetes_options_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
module DropletKit
class KubernetesOptionsMapping
include Kartograph::DSL

kartograph do
mapping KubernetesOptions
root_key singular: 'options', scopes: [:read]
Expand Down
1 change: 1 addition & 0 deletions lib/droplet_kit/resources/kubernetes_options_resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
module DropletKit
class KubernetesOptionsResource < ResourceKit::Resource
include ErrorHandlingResourcable

resources do
action :all, 'GET /v2/kubernetes/options' do
handler(200) { |response| KubernetesOptionsMapping.extract_single(response.body, :read) }
Expand Down
17 changes: 8 additions & 9 deletions spec/lib/droplet_kit/resources/database_resource_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -458,16 +458,15 @@
end

describe '#reset_database_user_auth' do
database_user = DropletKit::DatabaseUser.new(
name: 'app-01',
role: 'normal',
password: 'jge5lfxtzhx42iff',
mysql_settings: {
auth_plugin: 'mysql_native_password'
}
)

it 'resets the db user auth' do
database_user = DropletKit::DatabaseUser.new(
name: 'app-01',
role: 'normal',
password: 'jge5lfxtzhx42iff',
mysql_settings: {
auth_plugin: 'mysql_native_password'
}
)
request = stub_do_api("/v2/databases/#{database_cluster_id}/users/#{database_user.name}/reset_auth", :post).to_return(body: api_fixture('databases/reset_user_auth_response'), status: 200)
reset_auth = DropletKit::DatabaseUserResetAuth.new(
mysql_settings: DropletKit::DatabaseUserMySQLSettings.new(
Expand Down
40 changes: 20 additions & 20 deletions spec/lib/droplet_kit/resources/droplet_resource_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,13 @@ def check_droplet(droplet, tags = [], overrides = {})

context 'when creating with with_droplet_agent' do
context 'not set' do
droplet = DropletKit::Droplet.new(
name: 'test.example.com',
region: 'nyc1',
size: '512mb',
image: 'ubuntu-14-04-x86'
)
it 'does not include it in the request' do
droplet = DropletKit::Droplet.new(
name: 'test.example.com',
region: 'nyc1',
size: '512mb',
image: 'ubuntu-14-04-x86'
)
as_hash = DropletKit::DropletMapping.hash_for(:create, droplet)
expect(as_hash['with_droplet_agent']).to be_nil

Expand All @@ -216,14 +216,14 @@ def check_droplet(droplet, tags = [], overrides = {})
end

context 'set to false' do
droplet = DropletKit::Droplet.new(
name: 'test.example.com',
region: 'nyc1',
size: '512mb',
image: 'ubuntu-14-04-x86',
with_droplet_agent: false
)
it 'includes it in the request' do
droplet = DropletKit::Droplet.new(
name: 'test.example.com',
region: 'nyc1',
size: '512mb',
image: 'ubuntu-14-04-x86',
with_droplet_agent: false
)
as_hash = DropletKit::DropletMapping.hash_for(:create, droplet)
expect(as_hash['with_droplet_agent']).to eq(droplet.with_droplet_agent)

Expand All @@ -236,14 +236,14 @@ def check_droplet(droplet, tags = [], overrides = {})
end

context 'set to true' do
droplet = DropletKit::Droplet.new(
name: 'test.example.com',
region: 'nyc1',
size: '512mb',
image: 'ubuntu-14-04-x86',
with_droplet_agent: true
)
it 'includes it in the request' do
droplet = DropletKit::Droplet.new(
name: 'test.example.com',
region: 'nyc1',
size: '512mb',
image: 'ubuntu-14-04-x86',
with_droplet_agent: true
)
droplet.with_droplet_agent = true

as_hash = DropletKit::DropletMapping.hash_for(:create, droplet)
Expand Down
Loading