-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changes for docker package manager (#11217)
Changes for docker package manager metric collection(#11217)
- Loading branch information
1 parent
74c174a
commit c9d550b
Showing
4 changed files
with
106 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# typed: strong | ||
# frozen_string_literal: true | ||
|
||
require "sorbet-runtime" | ||
require "dependabot/docker/version" | ||
require "dependabot/ecosystem" | ||
require "dependabot/docker/requirement" | ||
|
||
module Dependabot | ||
module Docker | ||
ECOSYSTEM = "docker" | ||
|
||
SUPPORTED_VERSIONS = T.let([].freeze, T::Array[Dependabot::Version]) | ||
|
||
DEPRECATED_VERSIONS = T.let([].freeze, T::Array[Dependabot::Version]) | ||
|
||
class DockerPackageManager < Dependabot::Ecosystem::VersionManager | ||
extend T::Sig | ||
|
||
NAME = "docker" | ||
|
||
# As dockerfile updater is a inhouse custom utility, We use a placeholder | ||
# version number for dockerfile updater | ||
VERSION = "1.0.0" | ||
|
||
SUPPORTED_VERSIONS = T.let([].freeze, T::Array[Dependabot::Version]) | ||
|
||
DEPRECATED_VERSIONS = T.let([].freeze, T::Array[Dependabot::Version]) | ||
|
||
sig do | ||
void | ||
end | ||
def initialize | ||
super( | ||
name: NAME, | ||
version: Version.new(VERSION), | ||
deprecated_versions: DEPRECATED_VERSIONS, | ||
supported_versions: SUPPORTED_VERSIONS | ||
) | ||
end | ||
|
||
sig { override.returns(T::Boolean) } | ||
def deprecated? | ||
false | ||
end | ||
|
||
sig { override.returns(T::Boolean) } | ||
def unsupported? | ||
false | ||
end | ||
end | ||
end | ||
end |
33 changes: 33 additions & 0 deletions
33
docker/spec/dependabot/docker/docker_package_manager_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# typed: false | ||
# frozen_string_literal: true | ||
|
||
require "dependabot/docker/package_manager" | ||
require "dependabot/ecosystem" | ||
require "spec_helper" | ||
|
||
RSpec.describe Dependabot::Docker::DockerPackageManager do | ||
let(:package_manager) do | ||
described_class.new | ||
end | ||
|
||
describe "#initialize" do | ||
context "when docker package manager is initialised" do | ||
it "sets the name and version correctly" do | ||
expect(package_manager.name).to eq(Dependabot::Docker::DockerPackageManager::NAME) | ||
expect(package_manager.version.to_s).to eq("1.0.0") | ||
end | ||
end | ||
|
||
describe "#deprecated?" do | ||
it "returns always false" do | ||
expect(package_manager.deprecated?).to be false | ||
end | ||
end | ||
|
||
describe "#unsupported?" do | ||
it "returns always false" do | ||
expect(package_manager.unsupported?).to be false | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters