From e8fac6df843399ba974da7b3b97d94f6ed9d11b8 Mon Sep 17 00:00:00 2001 From: Ramesh Sencha Date: Tue, 28 Nov 2023 10:40:25 +0530 Subject: [PATCH 01/37] (CAT-1608) - PDK update --- .gitignore | 2 +- .pdkignore | 8 +- .rubocop.yml | 646 ++++++++++++++++++++++++++++++++++++++++- .rubocop_todo.yml | 39 +-- .sync.yml | 3 +- Gemfile | 48 +-- Rakefile | 9 +- metadata.json | 4 +- spec/default_facts.yml | 6 +- spec/spec_helper.rb | 4 +- 10 files changed, 686 insertions(+), 83 deletions(-) diff --git a/.gitignore b/.gitignore index 988dcbbe..3f155121 100644 --- a/.gitignore +++ b/.gitignore @@ -16,7 +16,7 @@ /log/ /pkg/ /spec/fixtures/manifests/ -/spec/fixtures/modules/ +/spec/fixtures/modules/* /tmp/ /vendor/ /convert_report.txt diff --git a/.pdkignore b/.pdkignore index 960a62ab..862847a7 100644 --- a/.pdkignore +++ b/.pdkignore @@ -16,7 +16,7 @@ /log/ /pkg/ /spec/fixtures/manifests/ -/spec/fixtures/modules/ +/spec/fixtures/modules/* /tmp/ /vendor/ /convert_report.txt @@ -26,21 +26,17 @@ .envrc /inventory.yaml /spec/fixtures/litmus_inventory.yaml -/appveyor.yml -/.editorconfig /.fixtures.yml /Gemfile /.gitattributes /.github/ /.gitignore -/.gitlab-ci.yml /.pdkignore /.puppet-lint.rc /Rakefile /rakelib/ /.rspec -/.rubocop.yml -/.travis.yml +/..yml /.yardopts /spec/ /.vscode/ diff --git a/.rubocop.yml b/.rubocop.yml index 2367276d..7a66e083 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -5,8 +5,6 @@ require: AllCops: NewCops: enable DisplayCopNames: true - ExtraDetails: true - DisplayStyleGuide: true TargetRubyVersion: '2.7' Include: - "**/*.rb" @@ -21,6 +19,7 @@ AllCops: - "**/Puppetfile" - "**/Vagrantfile" - "**/Guardfile" +inherit_from: ".rubocop_todo.yml" Layout/LineLength: Description: People have wide screens, use them. Max: 200 @@ -74,7 +73,6 @@ Style/TrailingCommaInArrayLiteral: Style/SymbolArray: Description: Using percent style obscures symbolic intent of array's contents. EnforcedStyle: brackets -inherit_from: ".rubocop_todo.yml" RSpec/MessageSpies: EnforcedStyle: receive Style/Documentation: @@ -83,5 +81,645 @@ Style/Documentation: - spec/**/* Style/WordArray: EnforcedStyle: brackets +Performance/AncestorsInclude: + Enabled: true +Performance/BigDecimalWithNumericArgument: + Enabled: true +Performance/BlockGivenWithExplicitBlock: + Enabled: true +Performance/CaseWhenSplat: + Enabled: true +Performance/ConstantRegexp: + Enabled: true +Performance/MethodObjectAsBlock: + Enabled: true +Performance/RedundantSortBlock: + Enabled: true +Performance/RedundantStringChars: + Enabled: true +Performance/ReverseFirst: + Enabled: true +Performance/SortReverse: + Enabled: true +Performance/Squeeze: + Enabled: true +Performance/StringInclude: + Enabled: true +Performance/Sum: + Enabled: true +Style/CollectionMethods: + Enabled: true +Style/MethodCalledOnDoEndBlock: + Enabled: true +Style/StringMethods: + Enabled: true +Bundler/GemFilename: + Enabled: false +Bundler/InsecureProtocolSource: + Enabled: false +Capybara/CurrentPathExpectation: + Enabled: false +Capybara/VisibilityMatcher: + Enabled: false +Gemspec/DuplicatedAssignment: + Enabled: false +Gemspec/OrderedDependencies: + Enabled: false +Gemspec/RequiredRubyVersion: + Enabled: false +Gemspec/RubyVersionGlobalsUsage: + Enabled: false +Layout/ArgumentAlignment: + Enabled: false +Layout/BeginEndAlignment: + Enabled: false +Layout/ClosingHeredocIndentation: + Enabled: false +Layout/EmptyComment: + Enabled: false +Layout/EmptyLineAfterGuardClause: + Enabled: false +Layout/EmptyLinesAroundArguments: + Enabled: false +Layout/EmptyLinesAroundAttributeAccessor: + Enabled: false +Layout/EndOfLine: + Enabled: false +Layout/FirstArgumentIndentation: + Enabled: false +Layout/HashAlignment: + Enabled: false +Layout/HeredocIndentation: + Enabled: false +Layout/LeadingEmptyLines: + Enabled: false +Layout/SpaceAroundMethodCallOperator: + Enabled: false +Layout/SpaceInsideArrayLiteralBrackets: + Enabled: false +Layout/SpaceInsideReferenceBrackets: + Enabled: false +Lint/BigDecimalNew: + Enabled: false +Lint/BooleanSymbol: + Enabled: false +Lint/ConstantDefinitionInBlock: + Enabled: false +Lint/DeprecatedOpenSSLConstant: + Enabled: false +Lint/DisjunctiveAssignmentInConstructor: + Enabled: false +Lint/DuplicateElsifCondition: + Enabled: false +Lint/DuplicateRequire: + Enabled: false +Lint/DuplicateRescueException: + Enabled: false +Lint/EmptyConditionalBody: + Enabled: false +Lint/EmptyFile: + Enabled: false +Lint/ErbNewArguments: + Enabled: false +Lint/FloatComparison: + Enabled: false +Lint/HashCompareByIdentity: + Enabled: false +Lint/IdentityComparison: + Enabled: false +Lint/InterpolationCheck: + Enabled: false +Lint/MissingCopEnableDirective: + Enabled: false +Lint/MixedRegexpCaptureTypes: + Enabled: false +Lint/NestedPercentLiteral: + Enabled: false +Lint/NonDeterministicRequireOrder: + Enabled: false +Lint/OrderedMagicComments: + Enabled: false +Lint/OutOfRangeRegexpRef: + Enabled: false +Lint/RaiseException: + Enabled: false +Lint/RedundantCopEnableDirective: + Enabled: false +Lint/RedundantRequireStatement: + Enabled: false +Lint/RedundantSafeNavigation: + Enabled: false +Lint/RedundantWithIndex: + Enabled: false +Lint/RedundantWithObject: + Enabled: false +Lint/RegexpAsCondition: + Enabled: false +Lint/ReturnInVoidContext: + Enabled: false +Lint/SafeNavigationConsistency: + Enabled: false +Lint/SafeNavigationWithEmpty: + Enabled: false +Lint/SelfAssignment: + Enabled: false +Lint/SendWithMixinArgument: + Enabled: false +Lint/ShadowedArgument: + Enabled: false +Lint/StructNewOverride: + Enabled: false +Lint/ToJSON: + Enabled: false +Lint/TopLevelReturnWithArgument: + Enabled: false +Lint/TrailingCommaInAttributeDeclaration: + Enabled: false +Lint/UnreachableLoop: + Enabled: false +Lint/UriEscapeUnescape: + Enabled: false +Lint/UriRegexp: + Enabled: false +Lint/UselessMethodDefinition: + Enabled: false +Lint/UselessTimes: + Enabled: false +Metrics/AbcSize: + Enabled: false +Metrics/BlockLength: + Enabled: false +Metrics/BlockNesting: + Enabled: false +Metrics/ClassLength: + Enabled: false +Metrics/CyclomaticComplexity: + Enabled: false +Metrics/MethodLength: + Enabled: false +Metrics/ModuleLength: + Enabled: false +Metrics/ParameterLists: + Enabled: false +Metrics/PerceivedComplexity: + Enabled: false +Migration/DepartmentName: + Enabled: false +Naming/AccessorMethodName: + Enabled: false +Naming/BlockParameterName: + Enabled: false +Naming/HeredocDelimiterCase: + Enabled: false +Naming/HeredocDelimiterNaming: + Enabled: false +Naming/MemoizedInstanceVariableName: + Enabled: false +Naming/MethodParameterName: + Enabled: false +Naming/RescuedExceptionsVariableName: + Enabled: false +Naming/VariableNumber: + Enabled: false +Performance/BindCall: + Enabled: false +Performance/DeletePrefix: + Enabled: false +Performance/DeleteSuffix: + Enabled: false +Performance/InefficientHashSearch: + Enabled: false +Performance/UnfreezeString: + Enabled: false +Performance/UriDefaultParser: + Enabled: false +RSpec/Be: + Enabled: false +RSpec/Capybara/FeatureMethods: + Enabled: false +RSpec/ContainExactly: + Enabled: false +RSpec/ContextMethod: + Enabled: false +RSpec/ContextWording: + Enabled: false +RSpec/DescribeClass: + Enabled: false +RSpec/EmptyHook: + Enabled: false +RSpec/EmptyLineAfterExample: + Enabled: false +RSpec/EmptyLineAfterExampleGroup: + Enabled: false +RSpec/EmptyLineAfterHook: + Enabled: false +RSpec/ExampleLength: + Enabled: false +RSpec/ExampleWithoutDescription: + Enabled: false +RSpec/ExpectChange: + Enabled: false +RSpec/ExpectInHook: + Enabled: false +RSpec/FactoryBot/AttributeDefinedStatically: + Enabled: false +RSpec/FactoryBot/CreateList: + Enabled: false +RSpec/FactoryBot/FactoryClassName: + Enabled: false +RSpec/HooksBeforeExamples: + Enabled: false +RSpec/ImplicitBlockExpectation: + Enabled: false +RSpec/ImplicitSubject: + Enabled: false +RSpec/LeakyConstantDeclaration: + Enabled: false +RSpec/LetBeforeExamples: + Enabled: false +RSpec/MatchArray: + Enabled: false +RSpec/MissingExampleGroupArgument: + Enabled: false RSpec/MultipleExpectations: - Max: 3 + Enabled: false +RSpec/MultipleMemoizedHelpers: + Enabled: false +RSpec/MultipleSubjects: + Enabled: false +RSpec/NestedGroups: + Enabled: false +RSpec/PredicateMatcher: + Enabled: false +RSpec/ReceiveCounts: + Enabled: false +RSpec/ReceiveNever: + Enabled: false +RSpec/RepeatedExampleGroupBody: + Enabled: false +RSpec/RepeatedExampleGroupDescription: + Enabled: false +RSpec/RepeatedIncludeExample: + Enabled: false +RSpec/ReturnFromStub: + Enabled: false +RSpec/SharedExamples: + Enabled: false +RSpec/StubbedMock: + Enabled: false +RSpec/UnspecifiedException: + Enabled: false +RSpec/VariableDefinition: + Enabled: false +RSpec/VoidExpect: + Enabled: false +RSpec/Yield: + Enabled: false +Security/Open: + Enabled: false +Style/AccessModifierDeclarations: + Enabled: false +Style/AccessorGrouping: + Enabled: false +Style/BisectedAttrAccessor: + Enabled: false +Style/CaseLikeIf: + Enabled: false +Style/ClassEqualityComparison: + Enabled: false +Style/ColonMethodDefinition: + Enabled: false +Style/CombinableLoops: + Enabled: false +Style/CommentedKeyword: + Enabled: false +Style/Dir: + Enabled: false +Style/DoubleCopDisableDirective: + Enabled: false +Style/EmptyBlockParameter: + Enabled: false +Style/EmptyLambdaParameter: + Enabled: false +Style/Encoding: + Enabled: false +Style/EvalWithLocation: + Enabled: false +Style/ExpandPathArguments: + Enabled: false +Style/ExplicitBlockArgument: + Enabled: false +Style/ExponentialNotation: + Enabled: false +Style/FloatDivision: + Enabled: false +Style/FrozenStringLiteralComment: + Enabled: false +Style/GlobalStdStream: + Enabled: false +Style/HashAsLastArrayItem: + Enabled: false +Style/HashLikeCase: + Enabled: false +Style/HashTransformKeys: + Enabled: false +Style/HashTransformValues: + Enabled: false +Style/IfUnlessModifier: + Enabled: false +Style/KeywordParametersOrder: + Enabled: false +Style/MinMax: + Enabled: false +Style/MixinUsage: + Enabled: false +Style/MultilineWhenThen: + Enabled: false +Style/NegatedUnless: + Enabled: false +Style/NumericPredicate: + Enabled: false +Style/OptionalBooleanParameter: + Enabled: false +Style/OrAssignment: + Enabled: false +Style/RandomWithOffset: + Enabled: false +Style/RedundantAssignment: + Enabled: false +Style/RedundantCondition: + Enabled: false +Style/RedundantConditional: + Enabled: false +Style/RedundantFetchBlock: + Enabled: false +Style/RedundantFileExtensionInRequire: + Enabled: false +Style/RedundantRegexpCharacterClass: + Enabled: false +Style/RedundantRegexpEscape: + Enabled: false +Style/RedundantSelfAssignment: + Enabled: false +Style/RedundantSort: + Enabled: false +Style/RescueStandardError: + Enabled: false +Style/SingleArgumentDig: + Enabled: false +Style/SlicingWithRange: + Enabled: false +Style/SoleNestedConditional: + Enabled: false +Style/StderrPuts: + Enabled: false +Style/StringConcatenation: + Enabled: false +Style/Strip: + Enabled: false +Style/SymbolProc: + Enabled: false +Style/TrailingBodyOnClass: + Enabled: false +Style/TrailingBodyOnMethodDefinition: + Enabled: false +Style/TrailingBodyOnModule: + Enabled: false +Style/TrailingCommaInHashLiteral: + Enabled: false +Style/TrailingMethodEndStatement: + Enabled: false +Style/UnpackFirst: + Enabled: false +Capybara/MatchStyle: + Enabled: false +Capybara/NegationMatcher: + Enabled: false +Capybara/SpecificActions: + Enabled: false +Capybara/SpecificFinders: + Enabled: false +Capybara/SpecificMatcher: + Enabled: false +Gemspec/DeprecatedAttributeAssignment: + Enabled: false +Gemspec/DevelopmentDependencies: + Enabled: false +Gemspec/RequireMFA: + Enabled: false +Layout/LineContinuationLeadingSpace: + Enabled: false +Layout/LineContinuationSpacing: + Enabled: false +Layout/LineEndStringConcatenationIndentation: + Enabled: false +Layout/SpaceBeforeBrackets: + Enabled: false +Lint/AmbiguousAssignment: + Enabled: false +Lint/AmbiguousOperatorPrecedence: + Enabled: false +Lint/AmbiguousRange: + Enabled: false +Lint/ConstantOverwrittenInRescue: + Enabled: false +Lint/DeprecatedConstants: + Enabled: false +Lint/DuplicateBranch: + Enabled: false +Lint/DuplicateMagicComment: + Enabled: false +Lint/DuplicateRegexpCharacterClassElement: + Enabled: false +Lint/EmptyBlock: + Enabled: false +Lint/EmptyClass: + Enabled: false +Lint/EmptyInPattern: + Enabled: false +Lint/IncompatibleIoSelectWithFiberScheduler: + Enabled: false +Lint/LambdaWithoutLiteralBlock: + Enabled: false +Lint/NoReturnInBeginEndBlocks: + Enabled: false +Lint/NonAtomicFileOperation: + Enabled: false +Lint/NumberedParameterAssignment: + Enabled: false +Lint/OrAssignmentToConstant: + Enabled: false +Lint/RedundantDirGlobSort: + Enabled: false +Lint/RefinementImportMethods: + Enabled: false +Lint/RequireRangeParentheses: + Enabled: false +Lint/RequireRelativeSelfPath: + Enabled: false +Lint/SymbolConversion: + Enabled: false +Lint/ToEnumArguments: + Enabled: false +Lint/TripleQuotes: + Enabled: false +Lint/UnexpectedBlockArity: + Enabled: false +Lint/UnmodifiedReduceAccumulator: + Enabled: false +Lint/UselessRescue: + Enabled: false +Lint/UselessRuby2Keywords: + Enabled: false +Metrics/CollectionLiteralLength: + Enabled: false +Naming/BlockForwarding: + Enabled: false +Performance/CollectionLiteralInLoop: + Enabled: false +Performance/ConcurrentMonotonicTime: + Enabled: false +Performance/MapCompact: + Enabled: false +Performance/RedundantEqualityComparisonBlock: + Enabled: false +Performance/RedundantSplitRegexpArgument: + Enabled: false +Performance/StringIdentifierArgument: + Enabled: false +RSpec/BeEq: + Enabled: false +RSpec/BeNil: + Enabled: false +RSpec/ChangeByZero: + Enabled: false +RSpec/ClassCheck: + Enabled: false +RSpec/DuplicatedMetadata: + Enabled: false +RSpec/ExcessiveDocstringSpacing: + Enabled: false +RSpec/FactoryBot/ConsistentParenthesesStyle: + Enabled: false +RSpec/FactoryBot/FactoryNameStyle: + Enabled: false +RSpec/FactoryBot/SyntaxMethods: + Enabled: false +RSpec/IdenticalEqualityAssertion: + Enabled: false +RSpec/NoExpectationExample: + Enabled: false +RSpec/PendingWithoutReason: + Enabled: false +RSpec/Rails/AvoidSetupHook: + Enabled: false +RSpec/Rails/HaveHttpStatus: + Enabled: false +RSpec/Rails/InferredSpecType: + Enabled: false +RSpec/Rails/MinitestAssertions: + Enabled: false +RSpec/Rails/TravelAround: + Enabled: false +RSpec/RedundantAround: + Enabled: false +RSpec/SkipBlockInsideExample: + Enabled: false +RSpec/SortMetadata: + Enabled: false +RSpec/SubjectDeclaration: + Enabled: false +RSpec/VerifiedDoubleReference: + Enabled: false +Security/CompoundHash: + Enabled: false +Security/IoMethods: + Enabled: false +Style/ArgumentsForwarding: + Enabled: false +Style/ArrayIntersect: + Enabled: false +Style/CollectionCompact: + Enabled: false +Style/ComparableClamp: + Enabled: false +Style/ConcatArrayLiterals: + Enabled: false +Style/DirEmpty: + Enabled: false +Style/DocumentDynamicEvalDefinition: + Enabled: false +Style/EmptyHeredoc: + Enabled: false +Style/EndlessMethod: + Enabled: false +Style/EnvHome: + Enabled: false +Style/FetchEnvVar: + Enabled: false +Style/FileEmpty: + Enabled: false +Style/FileRead: + Enabled: false +Style/FileWrite: + Enabled: false +Style/HashConversion: + Enabled: false +Style/HashExcept: + Enabled: false +Style/IfWithBooleanLiteralBranches: + Enabled: false +Style/InPatternThen: + Enabled: false +Style/MagicCommentFormat: + Enabled: false +Style/MapCompactWithConditionalBlock: + Enabled: false +Style/MapToHash: + Enabled: false +Style/MapToSet: + Enabled: false +Style/MinMaxComparison: + Enabled: false +Style/MultilineInPatternThen: + Enabled: false +Style/NegatedIfElseCondition: + Enabled: false +Style/NestedFileDirname: + Enabled: false +Style/NilLambda: + Enabled: false +Style/NumberedParameters: + Enabled: false +Style/NumberedParametersLimit: + Enabled: false +Style/ObjectThen: + Enabled: false +Style/OpenStructUse: + Enabled: false +Style/OperatorMethodCall: + Enabled: false +Style/QuotedSymbols: + Enabled: false +Style/RedundantArgument: + Enabled: false +Style/RedundantConstantBase: + Enabled: false +Style/RedundantDoubleSplatHashBraces: + Enabled: false +Style/RedundantEach: + Enabled: false +Style/RedundantHeredocDelimiterQuotes: + Enabled: false +Style/RedundantInitialize: + Enabled: false +Style/RedundantSelfAssignmentBranch: + Enabled: false +Style/RedundantStringEscape: + Enabled: false +Style/SelectByRegexp: + Enabled: false +Style/StringChars: + Enabled: false +Style/SwapValues: + Enabled: false diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 0157c284..32286ea0 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,49 +1,14 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2023-04-17 12:22:29 UTC using RuboCop version 1.48.1. +# on 2023-11-28 05:16:01 UTC using RuboCop version 1.48.1. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new # versions of RuboCop, may require this file to be generated again. -# Offense count: 11 -# Configuration parameters: IgnoredMetadata. -RSpec/DescribeClass: - Exclude: - - '**/spec/features/**/*' - - '**/spec/requests/**/*' - - '**/spec/routing/**/*' - - '**/spec/system/**/*' - - '**/spec/views/**/*' - - 'spec/acceptance/install_spec.rb' - - 'spec/classes/java_spec.rb' - - 'spec/defines/adopt_spec.rb' - - 'spec/defines/adoptium_spec.rb' - - 'spec/defines/download_spec.rb' - - 'spec/defines/sap_spec.rb' - - 'spec/unit/facter/java_default_home_spec.rb' - - 'spec/unit/facter/java_libjvm_path_spec.rb' - - 'spec/unit/facter/java_major_version_spec.rb' - - 'spec/unit/facter/java_patch_level_spec.rb' - - 'spec/unit/facter/java_version_spec.rb' - -# Offense count: 3 +# Offense count: 2 # Configuration parameters: EnforcedStyle, IgnoreSharedExamples. # SupportedStyles: always, named_only RSpec/NamedSubject: Exclude: - - 'spec/classes/java_spec.rb' - 'spec/defines/download_spec.rb' - -# Offense count: 12 -# Configuration parameters: AllowedPatterns. -# AllowedPatterns: ^expect_, ^assert_ -RSpec/NoExpectationExample: - Exclude: - - 'spec/acceptance/install_spec.rb' - - 'spec/unit/facter/java_default_home_spec.rb' - -# Offense count: 1 -Style/MixinUsage: - Exclude: - - 'spec/spec_helper.rb' diff --git a/.sync.yml b/.sync.yml index 28f0f9b0..5baf54b1 100644 --- a/.sync.yml +++ b/.sync.yml @@ -3,7 +3,8 @@ delete: true appveyor.yml: delete: true - +.rubocop.yml: + include_todos: true Gemfile: optional: ":development": diff --git a/Gemfile b/Gemfile index 6235e42e..86e337ad 100644 --- a/Gemfile +++ b/Gemfile @@ -14,31 +14,35 @@ def location_for(place_or_version, fake_version = nil) end group :development do - gem "json", '= 2.1.0', require: false if Gem::Requirement.create(['>= 2.5.0', '< 2.7.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) - gem "json", '= 2.3.0', require: false if Gem::Requirement.create(['>= 2.7.0', '< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) - gem "json", '= 2.5.1', require: false if Gem::Requirement.create(['>= 3.0.0', '< 3.0.5']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) - gem "json", '= 2.6.1', require: false if Gem::Requirement.create(['>= 3.1.0', '< 3.1.3']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) - gem "json", '= 2.6.3', require: false if Gem::Requirement.create(['>= 3.2.0', '< 4.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) - gem "voxpupuli-puppet-lint-plugins", '~> 4.0', require: false - gem "facterdb", '~> 1.18', require: false - gem "metadata-json-lint", '>= 2.0.2', '< 4.0.0', require: false - gem "puppetlabs_spec_helper", '~> 5.0', require: false - gem "rspec-puppet-facts", '~> 2.0', require: false - gem "codecov", '~> 0.2', require: false - gem "dependency_checker", '~> 0.2', require: false - gem "parallel_tests", '= 3.12.1', require: false - gem "pry", '~> 0.10', require: false - gem "simplecov-console", '~> 0.5', require: false - gem "puppet-debugger", '~> 1.0', require: false - gem "rubocop", '= 1.48.1', require: false - gem "rubocop-performance", '= 1.16.0', require: false - gem "rubocop-rspec", '= 2.19.0', require: false - gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw] - gem "github_changelog_generator", '= 1.15.2', require: false + gem "json", '= 2.1.0', require: false if Gem::Requirement.create(['>= 2.5.0', '< 2.7.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) + gem "json", '= 2.3.0', require: false if Gem::Requirement.create(['>= 2.7.0', '< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) + gem "json", '= 2.5.1', require: false if Gem::Requirement.create(['>= 3.0.0', '< 3.0.5']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) + gem "json", '= 2.6.1', require: false if Gem::Requirement.create(['>= 3.1.0', '< 3.1.3']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) + gem "json", '= 2.6.3', require: false if Gem::Requirement.create(['>= 3.2.0', '< 4.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) + gem "racc", '~> 1.4.0', require: false if Gem::Requirement.create(['>= 2.7.0', '< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) + gem "voxpupuli-puppet-lint-plugins", '~> 5.0', require: false + gem "facterdb", '~> 1.18', require: false + gem "metadata-json-lint", '~> 3.0', require: false + gem "rspec-puppet-facts", '~> 2.0', require: false + gem "codecov", '~> 0.2', require: false + gem "dependency_checker", '~> 1.0.0', require: false + gem "parallel_tests", '= 3.12.1', require: false + gem "pry", '~> 0.10', require: false + gem "simplecov-console", '~> 0.5', require: false + gem "puppet-debugger", '~> 1.0', require: false + gem "rubocop", '= 1.48.1', require: false + gem "rubocop-performance", '= 1.16.0', require: false + gem "rubocop-rspec", '= 2.19.0', require: false + gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw] + gem "github_changelog_generator", '= 1.15.2', require: false end group :system_tests do gem "puppet_litmus", '~> 1.0', require: false, platforms: [:ruby, :x64_mingw] - gem "serverspec", '~> 2.41', require: false + gem "serverspec", '~> 2.41', require: false +end +group :release_prep do + gem "puppet-strings", '~> 4.0', require: false + gem "puppetlabs_spec_helper", '~> 7.0', require: false end puppet_version = ENV['PUPPET_GEM_VERSION'] diff --git a/Rakefile b/Rakefile index 0f8754eb..74415a96 100644 --- a/Rakefile +++ b/Rakefile @@ -1,12 +1,11 @@ # frozen_string_literal: true require 'bundler' -require 'puppet_litmus/rake_tasks' if Bundler.rubygems.find_name('puppet_litmus').any? +require 'puppet_litmus/rake_tasks' if Gem.loaded_specs.key? 'puppet_litmus' require 'puppetlabs_spec_helper/rake_tasks' require 'puppet-syntax/tasks/puppet-syntax' -require 'puppet_blacksmith/rake_tasks' if Bundler.rubygems.find_name('puppet-blacksmith').any? -require 'github_changelog_generator/task' if Bundler.rubygems.find_name('github_changelog_generator').any? -require 'puppet-strings/tasks' if Bundler.rubygems.find_name('puppet-strings').any? +require 'github_changelog_generator/task' if Gem.loaded_specs.key? 'github_changelog_generator' +require 'puppet-strings/tasks' if Gem.loaded_specs.key? 'puppet-strings' def changelog_user return unless Rake.application.top_level_tasks.include? "changelog" @@ -44,7 +43,7 @@ end PuppetLint.configuration.send('disable_relative') -if Bundler.rubygems.find_name('github_changelog_generator').any? +if Gem.loaded_specs.key? 'github_changelog_generator' GitHubChangelogGenerator::RakeTask.new :changelog do |config| raise "Set CHANGELOG_GITHUB_TOKEN environment variable eg 'export CHANGELOG_GITHUB_TOKEN=valid_token_here'" if Rake.application.top_level_tasks.include? "changelog" and ENV['CHANGELOG_GITHUB_TOKEN'].nil? config.user = "#{changelog_user}" diff --git a/metadata.json b/metadata.json index 16926110..0a58b448 100644 --- a/metadata.json +++ b/metadata.json @@ -81,6 +81,6 @@ } ], "template-url": "https://github.com/puppetlabs/pdk-templates.git#main", - "template-ref": "heads/main-0-gc6d4446", - "pdk-version": "2.7.1" + "template-ref": "heads/main-0-g01c6a19", + "pdk-version": "3.0.0" } diff --git a/spec/default_facts.yml b/spec/default_facts.yml index f3946607..3346c394 100644 --- a/spec/default_facts.yml +++ b/spec/default_facts.yml @@ -3,7 +3,7 @@ # Facts specified here will override the values provided by rspec-puppet-facts. --- networking: - ip: "172.16.254.254" - ip6: "FE80:0000:0000:0000:AAAA:AAAA:AAAA" - mac: "AA:AA:AA:AA:AA:AA" + ip: "172.16.254.254" + ip6: "FE80:0000:0000:0000:AAAA:AAAA:AAAA" + mac: "AA:AA:AA:AA:AA:AA" is_pe: false diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index c6e55257..6820cebe 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -13,7 +13,7 @@ default_facts = { puppetversion: Puppet.version, - facterversion: Facter.version + facterversion: Facter.version, } default_fact_files = [ @@ -25,7 +25,7 @@ next unless File.exist?(f) && File.readable?(f) && File.size?(f) begin - default_facts.merge!(YAML.safe_load(File.read(f), [], [], true)) + default_facts.merge!(YAML.safe_load(File.read(f), permitted_classes: [], permitted_symbols: [], aliases: true)) rescue StandardError => e RSpec.configuration.reporter.message "WARNING: Unable to load #{f}: #{e}" end From 5cf4f07e63e9b9347cf754d37dd884e40045d3b0 Mon Sep 17 00:00:00 2001 From: Ramesh Sencha Date: Thu, 21 Dec 2023 13:02:43 +0530 Subject: [PATCH 02/37] (MAINT) PDK Update --- .sync.yml | 5 ---- Gemfile | 5 ++-- Rakefile | 79 --------------------------------------------------- metadata.json | 2 +- 4 files changed, 4 insertions(+), 87 deletions(-) diff --git a/.sync.yml b/.sync.yml index 5baf54b1..afecd940 100644 --- a/.sync.yml +++ b/.sync.yml @@ -5,11 +5,6 @@ appveyor.yml: delete: true .rubocop.yml: include_todos: true -Gemfile: - optional: - ":development": - - gem: github_changelog_generator - version: '= 1.15.2' spec/spec_helper.rb: mock_with: ":rspec" coverage_report: true diff --git a/Gemfile b/Gemfile index 86e337ad..ca0e773e 100644 --- a/Gemfile +++ b/Gemfile @@ -23,6 +23,7 @@ group :development do gem "voxpupuli-puppet-lint-plugins", '~> 5.0', require: false gem "facterdb", '~> 1.18', require: false gem "metadata-json-lint", '~> 3.0', require: false + gem "puppetlabs_spec_helper", '~> 6.0', require: false gem "rspec-puppet-facts", '~> 2.0', require: false gem "codecov", '~> 0.2', require: false gem "dependency_checker", '~> 1.0.0', require: false @@ -33,8 +34,8 @@ group :development do gem "rubocop", '= 1.48.1', require: false gem "rubocop-performance", '= 1.16.0', require: false gem "rubocop-rspec", '= 2.19.0', require: false + gem "puppet-strings", '~> 4.0', require: false gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw] - gem "github_changelog_generator", '= 1.15.2', require: false end group :system_tests do gem "puppet_litmus", '~> 1.0', require: false, platforms: [:ruby, :x64_mingw] @@ -42,7 +43,7 @@ group :system_tests do end group :release_prep do gem "puppet-strings", '~> 4.0', require: false - gem "puppetlabs_spec_helper", '~> 7.0', require: false + gem "puppetlabs_spec_helper", '~> 6.0', require: false end puppet_version = ENV['PUPPET_GEM_VERSION'] diff --git a/Rakefile b/Rakefile index 74415a96..77590fe6 100644 --- a/Rakefile +++ b/Rakefile @@ -4,85 +4,6 @@ require 'bundler' require 'puppet_litmus/rake_tasks' if Gem.loaded_specs.key? 'puppet_litmus' require 'puppetlabs_spec_helper/rake_tasks' require 'puppet-syntax/tasks/puppet-syntax' -require 'github_changelog_generator/task' if Gem.loaded_specs.key? 'github_changelog_generator' require 'puppet-strings/tasks' if Gem.loaded_specs.key? 'puppet-strings' -def changelog_user - return unless Rake.application.top_level_tasks.include? "changelog" - returnVal = nil || JSON.load(File.read('metadata.json'))['author'] - raise "unable to find the changelog_user in .sync.yml, or the author in metadata.json" if returnVal.nil? - puts "GitHubChangelogGenerator user:#{returnVal}" - returnVal -end - -def changelog_project - return unless Rake.application.top_level_tasks.include? "changelog" - - returnVal = nil - returnVal ||= begin - metadata_source = JSON.load(File.read('metadata.json'))['source'] - metadata_source_match = metadata_source && metadata_source.match(%r{.*\/([^\/]*?)(?:\.git)?\Z}) - - metadata_source_match && metadata_source_match[1] - end - - raise "unable to find the changelog_project in .sync.yml or calculate it from the source in metadata.json" if returnVal.nil? - - puts "GitHubChangelogGenerator project:#{returnVal}" - returnVal -end - -def changelog_future_release - return unless Rake.application.top_level_tasks.include? "changelog" - returnVal = "v%s" % JSON.load(File.read('metadata.json'))['version'] - raise "unable to find the future_release (version) in metadata.json" if returnVal.nil? - puts "GitHubChangelogGenerator future_release:#{returnVal}" - returnVal -end - PuppetLint.configuration.send('disable_relative') - - -if Gem.loaded_specs.key? 'github_changelog_generator' - GitHubChangelogGenerator::RakeTask.new :changelog do |config| - raise "Set CHANGELOG_GITHUB_TOKEN environment variable eg 'export CHANGELOG_GITHUB_TOKEN=valid_token_here'" if Rake.application.top_level_tasks.include? "changelog" and ENV['CHANGELOG_GITHUB_TOKEN'].nil? - config.user = "#{changelog_user}" - config.project = "#{changelog_project}" - config.future_release = "#{changelog_future_release}" - config.exclude_labels = ['maintenance'] - config.header = "# Change log\n\nAll notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org)." - config.add_pr_wo_labels = true - config.issues = false - config.merge_prefix = "### UNCATEGORIZED PRS; LABEL THEM ON GITHUB" - config.configure_sections = { - "Changed" => { - "prefix" => "### Changed", - "labels" => ["backwards-incompatible"], - }, - "Added" => { - "prefix" => "### Added", - "labels" => ["enhancement", "feature"], - }, - "Fixed" => { - "prefix" => "### Fixed", - "labels" => ["bug", "documentation", "bugfix"], - }, - } - end -else - desc 'Generate a Changelog from GitHub' - task :changelog do - raise < 1.15' - condition: "Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.3.0')" -EOM - end -end - diff --git a/metadata.json b/metadata.json index 0a58b448..b50a98a0 100644 --- a/metadata.json +++ b/metadata.json @@ -81,6 +81,6 @@ } ], "template-url": "https://github.com/puppetlabs/pdk-templates.git#main", - "template-ref": "heads/main-0-g01c6a19", + "template-ref": "heads/main-0-g79a2f93", "pdk-version": "3.0.0" } From f111a5f98c568135d71564847f151d483857bb21 Mon Sep 17 00:00:00 2001 From: Ramesh Sencha Date: Thu, 18 Jan 2024 18:14:25 +0530 Subject: [PATCH 03/37] (CAT-1696) - Skip CI pipeline for ARM OS --- .github/workflows/ci.yml | 1 + .github/workflows/nightly.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1b0e39c3..87458beb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,3 +17,4 @@ jobs: secrets: "inherit" with: runs_on: "ubuntu-20.04" + flags: "--exclude-platforms '[\"Ubuntu-22.04-arm\", \"RedHat-9-arm\"]'" diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index aaa4967f..ebbaa7ff 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -16,3 +16,4 @@ jobs: secrets: "inherit" with: runs_on: "ubuntu-20.04" + flags: "--exclude-platforms '[\"Ubuntu-22.04-arm\", \"RedHat-9-arm\"]'" From b4119681e47eb1dc5324e8d21b948e99c8926f85 Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Thu, 29 Feb 2024 12:01:22 +0100 Subject: [PATCH 04/37] Refactor params to have less duplication This introduces variables to make it easier to support multiple versions. --- manifests/params.pp | 57 +++++++++++++++++++++------------------------ 1 file changed, 27 insertions(+), 30 deletions(-) diff --git a/manifests/params.pp b/manifests/params.pp index cfbaa289..75c81292 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -11,27 +11,23 @@ 'AlmaLinux', 'Rocky', 'RedHat', 'CentOS', 'OracleLinux', 'Scientific', 'OEL', 'SLC', 'CloudLinux': { # See PR#160 / c8e46b5 for why >= 6.3 < 7.1 if (versioncmp($facts['os']['release']['full'], '7.1') < 0) { - $jdk_package = 'java-1.7.0-openjdk-devel' - $jre_package = 'java-1.7.0-openjdk' - $java_home = '/usr/lib/jvm/java-1.7.0/' - } - else { - $jdk_package = 'java-1.8.0-openjdk-devel' - $jre_package = 'java-1.8.0-openjdk' - $java_home = '/usr/lib/jvm/java-1.8.0/' + $openjdk = '1.7.0' + } else { + $openjdk = '1.8.0' } + $jdk_package = "java-${openjdk}-openjdk-devel" + $jre_package = "java-${openjdk}-openjdk" + $java_home = "/usr/lib/jvm/java-${openjdk}/" } 'Fedora': { if (versioncmp($facts['os']['release']['full'], '21') < 0) { - $jdk_package = 'java-1.7.0-openjdk-devel' - $jre_package = 'java-1.7.0-openjdk' - $java_home = "/usr/lib/jvm/java-1.7.0-openjdk-${facts['os']['architecture']}/" - } - else { - $jdk_package = 'java-1.8.0-openjdk-devel' - $jre_package = 'java-1.8.0-openjdk' - $java_home = "/usr/lib/jvm/java-1.8.0-openjdk-${facts['os']['architecture']}/" + $openjdk = '1.7.0' + } else { + $openjdk = '1.8.0' } + $jdk_package = "java-${openjdk}-openjdk-devel" + $jre_package = "java-${openjdk}-openjdk" + $java_home = "/usr/lib/jvm/java-${openjdk}-openjdk-${facts['os']['architecture']}/" } 'Amazon': { $jdk_package = 'java-1.7.0-openjdk-devel' @@ -63,23 +59,24 @@ } case $facts['os']['release']['major'] { '10', '11', '18.04', '18.10', '19.04', '19.10', '20.04', '22.04': { - $java = { - 'jdk' => { - 'package' => 'openjdk-11-jdk', - 'alternative' => "java-1.11.0-openjdk-${openjdk_architecture}", - 'alternative_path' => "/usr/lib/jvm/java-1.11.0-openjdk-${openjdk_architecture}/bin/java", - 'java_home' => "/usr/lib/jvm/java-1.11.0-openjdk-${openjdk_architecture}/", - }, - 'jre' => { - 'package' => 'openjdk-11-jre-headless', - 'alternative' => "java-1.11.0-openjdk-${openjdk_architecture}", - 'alternative_path' => "/usr/lib/jvm/java-1.11.0-openjdk-${openjdk_architecture}/bin/java", - 'java_home' => "/usr/lib/jvm/java-1.11.0-openjdk-${openjdk_architecture}/", - }, - } + $openjdk = 11 } default: { fail("unsupported release ${facts['os']['release']['major']}") } } + $java = { + 'jdk' => { + 'package' => "openjdk-${openjdk}-jdk", + 'alternative' => "java-1.${openjdk}.0-openjdk-${openjdk_architecture}", + 'alternative_path' => "/usr/lib/jvm/java-1.${openjdk}.0-openjdk-${openjdk_architecture}/bin/java", + 'java_home' => "/usr/lib/jvm/java-1.${openjdk}.0-openjdk-${openjdk_architecture}/", + }, + 'jre' => { + 'package' => "openjdk-${openjdk}-jre-headless", + 'alternative' => "java-1.${openjdk}.0-openjdk-${openjdk_architecture}", + 'alternative_path' => "/usr/lib/jvm/java-1.${openjdk}.0-openjdk-${openjdk_architecture}/bin/java", + 'java_home' => "/usr/lib/jvm/java-1.${openjdk}.0-openjdk-${openjdk_architecture}/", + }, + } } 'OpenBSD': { $java = { From bd970c95817fca74eb8cdb211e1eac7072b52fad Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Thu, 29 Feb 2024 12:05:51 +0100 Subject: [PATCH 05/37] Reduce duplication in spec tests by using nesting This sets up common contexts for an OS and then runs the tests within those. This avoids duplicating the fact definitions. --- spec/classes/java_spec.rb | 59 +++++++++++++++++++++------------------ 1 file changed, 32 insertions(+), 27 deletions(-) diff --git a/spec/classes/java_spec.rb b/spec/classes/java_spec.rb index 09906916..632987d5 100644 --- a/spec/classes/java_spec.rb +++ b/spec/classes/java_spec.rb @@ -10,49 +10,54 @@ it { is_expected.to contain_file_line('java-home-environment').with_line('JAVA_HOME=/usr/lib/jvm/java-1.8.0/') } end - context 'when selecting jdk for Debian Buster (10.0)' do + context 'on Debian Buster (10.0)' do let(:facts) { { os: { family: 'Debian', name: 'Debian', lsb: { distcodename: 'buster' }, release: { major: '10' }, architecture: 'amd64' } } } - let(:params) { { 'distribution' => 'jdk' } } - it { is_expected.to contain_package('java').with_name('openjdk-11-jdk') } - it { is_expected.to contain_file_line('java-home-environment').with_line('JAVA_HOME=/usr/lib/jvm/java-1.11.0-openjdk-amd64/') } - end + context 'when selecting jdk' do + let(:params) { { 'distribution' => 'jdk' } } - context 'when selecting jre for Debian Buster (10.0)' do - let(:facts) { { os: { family: 'Debian', name: 'Debian', lsb: { distcodename: 'buster' }, release: { major: '10' }, architecture: 'amd64' } } } - let(:params) { { 'distribution' => 'jre' } } + it { is_expected.to contain_package('java').with_name('openjdk-11-jdk') } + it { is_expected.to contain_file_line('java-home-environment').with_line('JAVA_HOME=/usr/lib/jvm/java-1.11.0-openjdk-amd64/') } + end + + context 'when selecting jre' do + let(:params) { { 'distribution' => 'jre' } } - it { is_expected.to contain_package('java').with_name('openjdk-11-jre-headless') } - it { is_expected.to contain_file_line('java-home-environment').with_line('JAVA_HOME=/usr/lib/jvm/java-1.11.0-openjdk-amd64/') } + it { is_expected.to contain_package('java').with_name('openjdk-11-jre-headless') } + it { is_expected.to contain_file_line('java-home-environment').with_line('JAVA_HOME=/usr/lib/jvm/java-1.11.0-openjdk-amd64/') } + end end - context 'when selecting jdk for Ubuntu Bionic (18.04)' do + context 'on Ubuntu Bionic (18.04)' do let(:facts) { { os: { family: 'Debian', name: 'Ubuntu', lsb: { distcodename: 'bionic' }, release: { major: '18.04' }, architecture: 'amd64' } } } - let(:params) { { 'distribution' => 'jdk' } } - it { is_expected.to contain_package('java').with_name('openjdk-11-jdk') } - it { is_expected.to contain_file_line('java-home-environment').with_line('JAVA_HOME=/usr/lib/jvm/java-1.11.0-openjdk-amd64/') } - end + context 'when selecting jdk' do + let(:params) { { 'distribution' => 'jdk' } } - context 'when selecting jre for Ubuntu Bionic (18.04)' do - let(:facts) { { os: { family: 'Debian', name: 'Ubuntu', lsb: { distcodename: 'bionic' }, release: { major: '18.04' }, architecture: 'amd64' } } } - let(:params) { { 'distribution' => 'jre' } } + it { is_expected.to contain_package('java').with_name('openjdk-11-jdk') } + it { is_expected.to contain_file_line('java-home-environment').with_line('JAVA_HOME=/usr/lib/jvm/java-1.11.0-openjdk-amd64/') } + end + + context 'when selecting jre' do + let(:params) { { 'distribution' => 'jre' } } - it { is_expected.to contain_package('java').with_name('openjdk-11-jre-headless') } - it { is_expected.to contain_file_line('java-home-environment').with_line('JAVA_HOME=/usr/lib/jvm/java-1.11.0-openjdk-amd64/') } + it { is_expected.to contain_package('java').with_name('openjdk-11-jre-headless') } + it { is_expected.to contain_file_line('java-home-environment').with_line('JAVA_HOME=/usr/lib/jvm/java-1.11.0-openjdk-amd64/') } + end end - context 'when selecting openjdk for Oracle Linux' do + context 'on Oracle Linux 7.0' do let(:facts) { { os: { family: 'RedHat', name: 'OracleLinux', release: { full: '7.0' }, architecture: 'x86_64' } } } - it { is_expected.to contain_package('java').with_name('java-1.7.0-openjdk-devel') } - end + context 'when selecting openjdk' do + it { is_expected.to contain_package('java').with_name('java-1.7.0-openjdk-devel') } + end - context 'when selecting passed value for Oracle Linux' do - let(:facts) { { os: { family: 'RedHat', name: 'OracleLinux', release: { full: '7.0' }, architecture: 'x86_64' } } } - let(:params) { { 'distribution' => 'jre' } } + context 'when selecting passed value for Oracle Linux' do + let(:params) { { 'distribution' => 'jre' } } - it { is_expected.to contain_package('java').with_name('java-1.7.0-openjdk') } + it { is_expected.to contain_package('java').with_name('java-1.7.0-openjdk') } + end end context 'when selecting passed value for Scientific Linux' do From 00c7eb14802f1658a24d842d8f8b9717ca2b7f5b Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Thu, 29 Feb 2024 12:03:21 +0100 Subject: [PATCH 06/37] Support Debian 12 --- manifests/params.pp | 3 +++ metadata.json | 3 ++- spec/classes/java_spec.rb | 18 ++++++++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/manifests/params.pp b/manifests/params.pp index 75c81292..a301347f 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -58,6 +58,9 @@ default => $facts['os']['architecture'] } case $facts['os']['release']['major'] { + '12': { + $openjdk = 17 + } '10', '11', '18.04', '18.10', '19.04', '19.10', '20.04', '22.04': { $openjdk = 11 } diff --git a/metadata.json b/metadata.json index b50a98a0..529e45f8 100644 --- a/metadata.json +++ b/metadata.json @@ -43,7 +43,8 @@ "operatingsystem": "Debian", "operatingsystemrelease": [ "10", - "11" + "11", + "12" ] }, { diff --git a/spec/classes/java_spec.rb b/spec/classes/java_spec.rb index 632987d5..9908af9c 100644 --- a/spec/classes/java_spec.rb +++ b/spec/classes/java_spec.rb @@ -28,6 +28,24 @@ end end + context 'on Debian Bookworm (12)' do + let(:facts) { { os: { family: 'Debian', name: 'Debian', lsb: { distcodename: 'bookworm' }, release: { major: '12' }, architecture: 'amd64' } } } + + context 'when selecting jdk' do + let(:params) { { 'distribution' => 'jdk' } } + + it { is_expected.to contain_package('java').with_name('openjdk-17-jdk') } + it { is_expected.to contain_file_line('java-home-environment').with_line('JAVA_HOME=/usr/lib/jvm/java-1.17.0-openjdk-amd64/') } + end + + context 'when selecting jre' do + let(:params) { { 'distribution' => 'jre' } } + + it { is_expected.to contain_package('java').with_name('openjdk-17-jre-headless') } + it { is_expected.to contain_file_line('java-home-environment').with_line('JAVA_HOME=/usr/lib/jvm/java-1.17.0-openjdk-amd64/') } + end + end + context 'on Ubuntu Bionic (18.04)' do let(:facts) { { os: { family: 'Debian', name: 'Ubuntu', lsb: { distcodename: 'bionic' }, release: { major: '18.04' }, architecture: 'amd64' } } } From 686ea55e571ac4efef76551b08ad2f1cc2ccfe08 Mon Sep 17 00:00:00 2001 From: Sven Dewit Date: Thu, 14 Mar 2024 11:49:17 +0100 Subject: [PATCH 07/37] fix: remove puppetlabs-puppet_agent pinning --- .fixtures.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.fixtures.yml b/.fixtures.yml index 4de712c2..c675307e 100644 --- a/.fixtures.yml +++ b/.fixtures.yml @@ -3,9 +3,7 @@ fixtures: archive: "https://github.com/voxpupuli/puppet-archive.git" facts: 'https://github.com/puppetlabs/puppetlabs-facts.git' stdlib: "https://github.com/puppetlabs/puppetlabs-stdlib.git" - puppet_agent: - repo: 'https://github.com/puppetlabs/puppetlabs-puppet_agent.git' - ref: v4.13.0 + puppet_agent: 'https://github.com/puppetlabs/puppetlabs-puppet_agent.git' provision: 'https://github.com/puppetlabs/provision.git' symlinks: java: "#{source_dir}" From baf10dcbc5b18e5a2087bdba0e690bc6d623ede6 Mon Sep 17 00:00:00 2001 From: Sven Dewit Date: Thu, 14 Mar 2024 12:20:25 +0100 Subject: [PATCH 08/37] chore: remove legacy symlink --- .fixtures.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.fixtures.yml b/.fixtures.yml index c675307e..c5ff6f25 100644 --- a/.fixtures.yml +++ b/.fixtures.yml @@ -5,5 +5,3 @@ fixtures: stdlib: "https://github.com/puppetlabs/puppetlabs-stdlib.git" puppet_agent: 'https://github.com/puppetlabs/puppetlabs-puppet_agent.git' provision: 'https://github.com/puppetlabs/provision.git' - symlinks: - java: "#{source_dir}" From fd4a9c9cfc2877b7ebfacec39c8d592f1c158fa3 Mon Sep 17 00:00:00 2001 From: Julien Godin Date: Thu, 21 Mar 2024 12:39:41 +0100 Subject: [PATCH 09/37] Feat: Allow to download from a login/password protected URL Signed-off-by: Julien Godin --- manifests/download.pp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/manifests/download.pp b/manifests/download.pp index e8593820..4d451ffc 100644 --- a/manifests/download.pp +++ b/manifests/download.pp @@ -28,11 +28,23 @@ # @param url # Full URL # +# @param username +# Username for the URL +# +# @param password +# Password for the URL +# # @param jce # Install Oracles Java Cryptographic Extensions into the JRE or JDK # # @param jce_url # Full URL to the jce zip file +# +# @param jce_username +# Username for the JCE URL +# +# @param jce_password +# Password for the JCE URL # # @param basedir # Directory under which the installation will occur. If not set, defaults to @@ -62,8 +74,12 @@ Optional[String] $proxy_server = undef, Optional[Enum['none', 'http', 'https', 'ftp']] $proxy_type = undef, Optional[String] $url = undef, + Optional[String] $username = undef, + Optional[String] $password = undef, Boolean $jce = false, Optional[String] $jce_url = undef, + Optional[String] $jce_username = undef, + Optional[String] $jce_password = undef, Optional[String] $basedir = undef, Boolean $manage_basedir = false, Optional[String] $package_type = undef, @@ -258,6 +274,8 @@ archive { $destination : ensure => present, source => $source, + username => $username, + password => $password, extract_path => '/tmp', cleanup => false, creates => $creates_path, @@ -309,6 +327,8 @@ extract_path => $jce_path, extract_flags => '-oj', creates => "${jce_path}/US_export_policy.jar", + username => $jce_username, + password => $jce_password, cleanup => false, proxy_server => $proxy_server, proxy_type => $proxy_type, From 9669378fb2fb147772df4e0504cc2bcf34988368 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Tue, 26 Mar 2024 14:14:38 +0100 Subject: [PATCH 10/37] Add bastelfreak to CODEOWNERS I'm in the trusted contributors group but somehow the CODEOWNERS change was missing. --- CODEOWNERS | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CODEOWNERS b/CODEOWNERS index a5d109e9..13360c54 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -1,2 +1,3 @@ # Setting ownership to the modules team -* @puppetlabs/modules +# include Trusted Contributors +* @puppetlabs/modules @bastelfreak From 5d7eb1bcd9ec7f2723638e00a74f083d7dc1ff24 Mon Sep 17 00:00:00 2001 From: Malik Parvez <84777619+malikparvez@users.noreply.github.com> Date: Tue, 2 Apr 2024 21:09:38 +0530 Subject: [PATCH 11/37] Fix mend to run on cron --- .github/workflows/mend.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/mend.yml b/.github/workflows/mend.yml index b4100a5a..8b5b4018 100644 --- a/.github/workflows/mend.yml +++ b/.github/workflows/mend.yml @@ -1,9 +1,10 @@ name: "mend" on: - pull_request: - branches: - - "main" + pull_request_target: + types: + - opened + - synchronize schedule: - cron: "0 0 * * *" workflow_dispatch: From db63dcf1c576e7de1469e749090686e49ee556b8 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Mon, 15 Apr 2024 06:46:38 +0000 Subject: [PATCH 12/37] Release prep v11.0.0 --- CHANGELOG.md | 41 ++++++++++++------- REFERENCE.md | 107 +++++++++++++++++++++++++------------------------- metadata.json | 2 +- 3 files changed, 81 insertions(+), 69 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a46653af..8cb6b800 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org). +## [v11.0.0](https://github.com/puppetlabs/puppetlabs-java/tree/v11.0.0) - 2024-04-15 + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v10.1.2...v11.0.0) + +### Changed +- [CAT-1427] : Removing RedHat/Scientific/OracleLinux 6 [#576](https://github.com/puppetlabs/puppetlabs-java/pull/576) ([rajat-puppet](https://github.com/rajat-puppet)) + +### Added + +- Support Debian 12 and refactor to make that easier [#585](https://github.com/puppetlabs/puppetlabs-java/pull/585) ([ekohl](https://github.com/ekohl)) + ## [v10.1.2](https://github.com/puppetlabs/puppetlabs-java/tree/v10.1.2) - 2023-07-27 [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v10.1.1...v10.1.2) @@ -30,13 +41,13 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v9.0.1...v10.0.0) +### Changed +- (CONT-784) Add Support for Puppet 8 / Drop Support for Puppet 6 [#548](https://github.com/puppetlabs/puppetlabs-java/pull/548) ([david22swan](https://github.com/david22swan)) + ### Added - (CONT-356) Syntax update [#543](https://github.com/puppetlabs/puppetlabs-java/pull/543) ([LukasAud](https://github.com/LukasAud)) -### Changed -- (CONT-784) Add Support for Puppet 8 / Drop Support for Puppet 6 [#548](https://github.com/puppetlabs/puppetlabs-java/pull/548) ([david22swan](https://github.com/david22swan)) - ### Fixed - Fix shell_escape of unless command [#550](https://github.com/puppetlabs/puppetlabs-java/pull/550) ([traylenator](https://github.com/traylenator)) @@ -87,13 +98,13 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v7.3.0...v8.0.0) +### Changed +- (GH-C&T-7) Remove code specific to unsupported OSs [#507](https://github.com/puppetlabs/puppetlabs-java/pull/507) ([david22swan](https://github.com/david22swan)) + ### Added - (MODULES-11234) Support Adoptium Temurin [#502](https://github.com/puppetlabs/puppetlabs-java/pull/502) ([dploeger](https://github.com/dploeger)) -### Changed -- (GH-C&T-7) Remove code specific to unsupported OSs [#507](https://github.com/puppetlabs/puppetlabs-java/pull/507) ([david22swan](https://github.com/david22swan)) - ### Fixed - pdksync - (GH-iac-334) Remove Support for Ubuntu 14.04/16.04 [#505](https://github.com/puppetlabs/puppetlabs-java/pull/505) ([david22swan](https://github.com/david22swan)) @@ -235,15 +246,15 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v4.1.0...v5.0.0) +### Changed +- [FM-8320] Remove Oracle download [#372](https://github.com/puppetlabs/puppetlabs-java/pull/372) ([carabasdaniel](https://github.com/carabasdaniel)) + ### Added - (FM-8223) converted to use litmus [#376](https://github.com/puppetlabs/puppetlabs-java/pull/376) ([tphoney](https://github.com/tphoney)) - Add buster support, default to 11 [#369](https://github.com/puppetlabs/puppetlabs-java/pull/369) ([mhjacks](https://github.com/mhjacks)) - Add support for debian buster [#364](https://github.com/puppetlabs/puppetlabs-java/pull/364) ([TomRitserveldt](https://github.com/TomRitserveldt)) -### Changed -- [FM-8320] Remove Oracle download [#372](https://github.com/puppetlabs/puppetlabs-java/pull/372) ([carabasdaniel](https://github.com/carabasdaniel)) - ### Fixed - (FM-8343) use release numbers not lsbdistcodename [#375](https://github.com/puppetlabs/puppetlabs-java/pull/375) ([tphoney](https://github.com/tphoney)) @@ -261,6 +272,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/3.3.0...v4.0.0) +### Changed +- pdksync - (MODULES-8444) - Raise lower Puppet bound [#356](https://github.com/puppetlabs/puppetlabs-java/pull/356) ([david22swan](https://github.com/david22swan)) + ### Added - (FM-7921) - Implement Puppet Strings [#353](https://github.com/puppetlabs/puppetlabs-java/pull/353) ([david22swan](https://github.com/david22swan)) @@ -268,9 +282,6 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - Add ability to override basedir and package type for oracle java [#345](https://github.com/puppetlabs/puppetlabs-java/pull/345) ([fraenki](https://github.com/fraenki)) - MODULES-8613: Add option to set a custom JCE download URL [#344](https://github.com/puppetlabs/puppetlabs-java/pull/344) ([HielkeJ](https://github.com/HielkeJ)) -### Changed -- pdksync - (MODULES-8444) - Raise lower Puppet bound [#356](https://github.com/puppetlabs/puppetlabs-java/pull/356) ([david22swan](https://github.com/david22swan)) - ### Fixed - MODULES-8698: Fix $install_path on CentOS with tar.gz package type [#349](https://github.com/puppetlabs/puppetlabs-java/pull/349) ([fraenki](https://github.com/fraenki)) @@ -316,13 +327,13 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/2.4.0...3.0.0) +### Changed +- [FM-6963] Removal of unsupported OS from java [#295](https://github.com/puppetlabs/puppetlabs-java/pull/295) ([david22swan](https://github.com/david22swan)) + ### Added - (MODULES-7561) - Addition of support for Ubuntu 18.04 to java [#299](https://github.com/puppetlabs/puppetlabs-java/pull/299) ([david22swan](https://github.com/david22swan)) -### Changed -- [FM-6963] Removal of unsupported OS from java [#295](https://github.com/puppetlabs/puppetlabs-java/pull/295) ([david22swan](https://github.com/david22swan)) - ### Fixed - Remove ensure_resource to avoid potential conflict [#287](https://github.com/puppetlabs/puppetlabs-java/pull/287) ([sevencastles](https://github.com/sevencastles)) diff --git a/REFERENCE.md b/REFERENCE.md index 9ed34192..f8064267 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -137,7 +137,7 @@ The following parameters are available in the `java::adopt` defined type: ##### `ensure` -Data type: `Any` +Data type: `Enum['present']` Install or remove the package. @@ -145,7 +145,7 @@ Default value: `'present'` ##### `version` -Data type: `Any` +Data type: `String[1]` Version of Java to install, e.g. '8' or '9'. Default values for major and minor versions will be used. @@ -153,7 +153,7 @@ Default value: `'8'` ##### `version_major` -Data type: `Any` +Data type: `Optional[String]` Major version which should be installed, e.g. '8u101' or '9.0.4'. Must be used together with version_minor. @@ -161,15 +161,16 @@ Default value: `undef` ##### `version_minor` -Data type: `Any` +Data type: `Optional[String]` -Minor version which should be installed, e.g. 'b12' (for version = '8') or '11' (for version != '8'). Must be used together with version_major. +Minor version which should be installed, e.g. 'b12' (for version = '8') or '11' (for version != '8'). +Must be used together with version_major. Default value: `undef` ##### `java` -Data type: `Any` +Data type: `String[1]` Type of Java Standard Edition to install, jdk or jre. @@ -177,7 +178,7 @@ Default value: `'jdk'` ##### `proxy_server` -Data type: `Any` +Data type: `Optional[String]` Specify a proxy server, with port number if needed. ie: https://example.com:8080. (passed to archive) @@ -185,7 +186,7 @@ Default value: `undef` ##### `proxy_type` -Data type: `Any` +Data type: `Optional[String]` Proxy server type (none|http|https|ftp). (passed to archive) @@ -193,7 +194,7 @@ Default value: `undef` ##### `url` -Data type: `Any` +Data type: `Optional[String]` Full URL @@ -201,7 +202,7 @@ Default value: `undef` ##### `basedir` -Data type: `Any` +Data type: `Optional[String]` Directory under which the installation will occur. If not set, defaults to /usr/lib/jvm for Debian and /usr/java for RedHat. @@ -210,16 +211,16 @@ Default value: `undef` ##### `manage_basedir` -Data type: `Any` +Data type: `Boolean` -Whether to manage the basedir directory. Defaults to false. +Whether to manage the basedir directory. Note: /usr/lib/jvm is managed for Debian by default, separate from this parameter. Default value: `true` ##### `package_type` -Data type: `Any` +Data type: `Optional[String]` Type of installation package for specified version of java_se. java_se 6 comes in a few installation package flavors and we need to account for them. @@ -229,7 +230,7 @@ Default value: `undef` ##### `manage_symlink` -Data type: `Any` +Data type: `Boolean` Whether to manage a symlink that points to the installation directory. Defaults to false. @@ -237,7 +238,7 @@ Default value: `false` ##### `symlink_name` -Data type: `Any` +Data type: `Optional[String]` The name for the optional symlink in the installation directory. @@ -266,7 +267,7 @@ The following parameters are available in the `java::adoptium` defined type: ##### `ensure` -Data type: `Any` +Data type: `Enum['present']` Install or remove the package. @@ -274,7 +275,7 @@ Default value: `'present'` ##### `version_major` -Data type: `Any` +Data type: `Optional[String]` Major version which should be installed, e.g. '16' or '17' @@ -282,7 +283,7 @@ Default value: `undef` ##### `version_minor` -Data type: `Any` +Data type: `Optional[String]` Minor version which should be installed, e.g. '0' @@ -290,7 +291,7 @@ Default value: `undef` ##### `version_patch` -Data type: `Any` +Data type: `Optional[String]` Minor version which should be installed, e.g. '2' @@ -298,7 +299,7 @@ Default value: `undef` ##### `version_build` -Data type: `Any` +Data type: `Optional[String]` Build version which should be installed, e.g. '07' @@ -306,7 +307,7 @@ Default value: `undef` ##### `proxy_server` -Data type: `Any` +Data type: `Optional[String]` Specify a proxy server, with port number if needed. ie: https://example.com:8080. (passed to archive) @@ -314,7 +315,7 @@ Default value: `undef` ##### `proxy_type` -Data type: `Any` +Data type: `Optional[Enum['none', 'http', 'https', 'ftp']]` Proxy server type (none|http|https|ftp). (passed to archive) @@ -322,7 +323,7 @@ Default value: `undef` ##### `url` -Data type: `Any` +Data type: `Optional[String]` Full URL @@ -330,7 +331,7 @@ Default value: `undef` ##### `basedir` -Data type: `Any` +Data type: `Optional[String]` Directory under which the installation will occur. If not set, defaults to /usr/lib/jvm for Debian and /usr/java for RedHat. @@ -339,7 +340,7 @@ Default value: `undef` ##### `manage_basedir` -Data type: `Any` +Data type: `Boolean` Whether to manage the basedir directory. Defaults to false. Note: /usr/lib/jvm is managed for Debian by default, separate from this parameter. @@ -348,7 +349,7 @@ Default value: `true` ##### `manage_symlink` -Data type: `Any` +Data type: `Boolean` Whether to manage a symlink that points to the installation directory. Defaults to false. @@ -356,7 +357,7 @@ Default value: `false` ##### `symlink_name` -Data type: `Any` +Data type: `Optional[String]` The name for the optional symlink in the installation directory. @@ -388,7 +389,7 @@ The following parameters are available in the `java::download` defined type: ##### `ensure` -Data type: `Any` +Data type: `Enum['present']` Install or remove the package. @@ -396,7 +397,7 @@ Default value: `'present'` ##### `version` -Data type: `Any` +Data type: `String[1]` Version of Java to install, e.g. '7' or '8'. Default values for major and minor versions will be used. @@ -404,7 +405,7 @@ Default value: `'8'` ##### `version_major` -Data type: `Any` +Data type: `Optional[String]` Major version which should be installed, e.g. '8u101'. Must be used together with version_minor. @@ -412,7 +413,7 @@ Default value: `undef` ##### `version_minor` -Data type: `Any` +Data type: `Optional[String]` Minor version which should be installed, e.g. 'b12'. Must be used together with version_major. @@ -420,7 +421,7 @@ Default value: `undef` ##### `java_se` -Data type: `Any` +Data type: `String[1]` Type of Java Standard Edition to install, jdk or jre. @@ -428,7 +429,7 @@ Default value: `'jdk'` ##### `proxy_server` -Data type: `Any` +Data type: `Optional[String]` Specify a proxy server, with port number if needed. ie: https://example.com:8080. (passed to archive) @@ -436,7 +437,7 @@ Default value: `undef` ##### `proxy_type` -Data type: `Any` +Data type: `Optional[Enum['none', 'http', 'https', 'ftp']]` Proxy server type (none|http|https|ftp). (passed to archive) @@ -444,7 +445,7 @@ Default value: `undef` ##### `url` -Data type: `Any` +Data type: `Optional[String]` Full URL @@ -452,7 +453,7 @@ Default value: `undef` ##### `jce` -Data type: `Any` +Data type: `Boolean` Install Oracles Java Cryptographic Extensions into the JRE or JDK @@ -460,7 +461,7 @@ Default value: `false` ##### `jce_url` -Data type: `Any` +Data type: `Optional[String]` Full URL to the jce zip file @@ -468,7 +469,7 @@ Default value: `undef` ##### `basedir` -Data type: `Any` +Data type: `Optional[String]` Directory under which the installation will occur. If not set, defaults to /usr/lib/jvm for Debian and /usr/java for RedHat. @@ -477,7 +478,7 @@ Default value: `undef` ##### `manage_basedir` -Data type: `Any` +Data type: `Boolean` Whether to manage the basedir directory. Defaults to false. Note: /usr/lib/jvm is managed for Debian by default, separate from this parameter. @@ -486,7 +487,7 @@ Default value: `false` ##### `package_type` -Data type: `Any` +Data type: `Optional[String]` Type of installation package for specified version of java_se. java_se 6 comes in a few installation package flavors and we need to account for them. @@ -496,7 +497,7 @@ Default value: `undef` ##### `manage_symlink` -Data type: `Any` +Data type: `Boolean` Whether to manage a symlink that points to the installation directory. Defaults to false. @@ -504,7 +505,7 @@ Default value: `false` ##### `symlink_name` -Data type: `Any` +Data type: `Optional[String]` The name for the optional symlink in the installation directory. @@ -531,7 +532,7 @@ The following parameters are available in the `java::sap` defined type: ##### `ensure` -Data type: `Any` +Data type: `Enum['present']` Install or remove the package. @@ -539,7 +540,7 @@ Default value: `'present'` ##### `version` -Data type: `Any` +Data type: `String[1]` Version of Java to install, e.g. '8' or '9'. Default values for full versions will be used. @@ -547,7 +548,7 @@ Default value: `'8'` ##### `version_full` -Data type: `Any` +Data type: `Optional[String]` Major version which should be installed, e.g. '8.1.063' or '11.0.7'. If used, "version" parameter is ignored. @@ -555,7 +556,7 @@ Default value: `undef` ##### `java` -Data type: `Any` +Data type: `String[1]` Type of Java Edition to install, jdk or jre. @@ -563,7 +564,7 @@ Default value: `'jdk'` ##### `proxy_server` -Data type: `Any` +Data type: `Optional[String]` Specify a proxy server, with port number if needed. ie: https://example.com:8080. (passed to archive) @@ -571,7 +572,7 @@ Default value: `undef` ##### `proxy_type` -Data type: `Any` +Data type: `Optional[Enum['none', 'http', 'https', 'ftp']]` Proxy server type (none|http|https|ftp). (passed to archive) @@ -579,7 +580,7 @@ Default value: `undef` ##### `basedir` -Data type: `Any` +Data type: `Optional[String]` Directory under which the installation will occur. If not set, defaults to /usr/lib/jvm for Debian and /usr/java for RedHat. @@ -588,16 +589,16 @@ Default value: `undef` ##### `manage_basedir` -Data type: `Any` +Data type: `Boolean` -Whether to manage the basedir directory. Defaults to false. +Whether to manage the basedir directory. Note: /usr/lib/jvm is managed for Debian by default, separate from this parameter. Default value: `true` ##### `manage_symlink` -Data type: `Any` +Data type: `Boolean` Whether to manage a symlink that points to the installation directory. Defaults to false. @@ -605,7 +606,7 @@ Default value: `false` ##### `symlink_name` -Data type: `Any` +Data type: `Optional[String]` The name for the optional symlink in the installation directory. diff --git a/metadata.json b/metadata.json index 529e45f8..8fe1c175 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "puppetlabs-java", - "version": "10.1.2", + "version": "11.0.0", "author": "puppetlabs", "summary": "Installs the correct Java package on various platforms.", "license": "Apache-2.0", From 7a86199de35d825919390358d3bac271f5a55531 Mon Sep 17 00:00:00 2001 From: Malik Parvez <84777619+malikparvez@users.noreply.github.com> Date: Tue, 21 May 2024 21:14:32 +0530 Subject: [PATCH 13/37] ITHELP-87329 : replace pull_request_target with pull_request --- .github/workflows/mend.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/mend.yml b/.github/workflows/mend.yml index 8b5b4018..b4100a5a 100644 --- a/.github/workflows/mend.yml +++ b/.github/workflows/mend.yml @@ -1,10 +1,9 @@ name: "mend" on: - pull_request_target: - types: - - opened - - synchronize + pull_request: + branches: + - "main" schedule: - cron: "0 0 * * *" workflow_dispatch: From 6209e8190202d6b6343048486c6ef0ba381221a1 Mon Sep 17 00:00:00 2001 From: Malik Parvez <84777619+malikparvez@users.noreply.github.com> Date: Tue, 4 Jun 2024 13:55:04 +0530 Subject: [PATCH 14/37] ITHELP-87329 : replace pull_request_target with pull_request --- .github/workflows/labeller.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/labeller.yml b/.github/workflows/labeller.yml index ee149bf5..0d4870d7 100644 --- a/.github/workflows/labeller.yml +++ b/.github/workflows/labeller.yml @@ -6,7 +6,7 @@ on: - opened - labeled - unlabeled - pull_request_target: + pull_request: types: - opened - labeled From a26b3eae52177b7a1e6e6ebe27b2d6922e232c19 Mon Sep 17 00:00:00 2001 From: rajat-puppet Date: Mon, 22 Jul 2024 17:31:19 +0530 Subject: [PATCH 15/37] Remove labeller.yml --- .github/workflows/labeller.yml | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 .github/workflows/labeller.yml diff --git a/.github/workflows/labeller.yml b/.github/workflows/labeller.yml deleted file mode 100644 index 0d4870d7..00000000 --- a/.github/workflows/labeller.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Labeller - -on: - issues: - types: - - opened - - labeled - - unlabeled - pull_request: - types: - - opened - - labeled - - unlabeled - -jobs: - label: - runs-on: ubuntu-latest - steps: - - - uses: puppetlabs/community-labeller@v1.0.1 - name: Label issues or pull requests - with: - label_name: community - label_color: '5319e7' - org_membership: puppetlabs - fail_if_member: 'true' - token: ${{ secrets.IAC_COMMUNITY_LABELER }} From 63955c95be883b1cb2fc12f9b5ebcf79af5e3214 Mon Sep 17 00:00:00 2001 From: Amit Karsale Date: Tue, 10 Sep 2024 10:52:28 +0530 Subject: [PATCH 16/37] pdksync - (PF-3525) - pdk update for module --- .github/workflows/ci.yml | 3 ++- .github/workflows/nightly.yml | 3 ++- .github/workflows/release.yml | 2 +- .gitignore | 7 +++++++ .pdkignore | 7 +++++++ .rubocop.yml | 8 +++++++- .vscode/extensions.json | 2 +- Gemfile | 28 ++++++++++++++-------------- metadata.json | 4 ++-- spec/spec_helper.rb | 5 +++-- 10 files changed, 46 insertions(+), 23 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 87458beb..459c9045 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,4 +17,5 @@ jobs: secrets: "inherit" with: runs_on: "ubuntu-20.04" - flags: "--exclude-platforms '[\"Ubuntu-22.04-arm\", \"RedHat-9-arm\"]'" + flags: "--exclude-platforms '[\"Ubuntu-22.04-arm\", \"RedHat-9-arm\", \"Debian-12-arm\"]'" + \ No newline at end of file diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index ebbaa7ff..22544b8f 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -16,4 +16,5 @@ jobs: secrets: "inherit" with: runs_on: "ubuntu-20.04" - flags: "--exclude-platforms '[\"Ubuntu-22.04-arm\", \"RedHat-9-arm\"]'" + flags: "--exclude-platforms '[\"Ubuntu-22.04-arm\", \"RedHat-9-arm\", \"Debian-12-arm\"]'" + \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0b7b8a05..4b3b80fc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,7 +2,7 @@ name: "Publish module" on: workflow_dispatch: - + jobs: release: uses: "puppetlabs/cat-github-actions/.github/workflows/module_release.yml@main" diff --git a/.gitignore b/.gitignore index 3f155121..2803e566 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,7 @@ /spec/fixtures/modules/* /tmp/ /vendor/ +/.vendor/ /convert_report.txt /update_report.txt .DS_Store @@ -26,3 +27,9 @@ .envrc /inventory.yaml /spec/fixtures/litmus_inventory.yaml +.resource_types +.modules +.task_cache.json +.plan_cache.json +.rerun.json +bolt-debug.log diff --git a/.pdkignore b/.pdkignore index 862847a7..84684be6 100644 --- a/.pdkignore +++ b/.pdkignore @@ -19,6 +19,7 @@ /spec/fixtures/modules/* /tmp/ /vendor/ +/.vendor/ /convert_report.txt /update_report.txt .DS_Store @@ -26,6 +27,12 @@ .envrc /inventory.yaml /spec/fixtures/litmus_inventory.yaml +.resource_types +.modules +.task_cache.json +.plan_cache.json +.rerun.json +bolt-debug.log /.fixtures.yml /Gemfile /.gitattributes diff --git a/.rubocop.yml b/.rubocop.yml index 7a66e083..439ea84e 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -5,7 +5,7 @@ require: AllCops: NewCops: enable DisplayCopNames: true - TargetRubyVersion: '2.7' + TargetRubyVersion: '2.6' Include: - "**/*.rb" Exclude: @@ -529,6 +529,8 @@ Lint/DuplicateBranch: Enabled: false Lint/DuplicateMagicComment: Enabled: false +Lint/DuplicateMatchPattern: + Enabled: false Lint/DuplicateRegexpCharacterClassElement: Enabled: false Lint/EmptyBlock: @@ -645,6 +647,8 @@ Style/ComparableClamp: Enabled: false Style/ConcatArrayLiterals: Enabled: false +Style/DataInheritance: + Enabled: false Style/DirEmpty: Enabled: false Style/DocumentDynamicEvalDefinition: @@ -713,6 +717,8 @@ Style/RedundantHeredocDelimiterQuotes: Enabled: false Style/RedundantInitialize: Enabled: false +Style/RedundantLineContinuation: + Enabled: false Style/RedundantSelfAssignmentBranch: Enabled: false Style/RedundantStringEscape: diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 2f1e4f73..6da8d472 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,6 +1,6 @@ { "recommendations": [ "puppet.puppet-vscode", - "rebornix.Ruby" + "Shopify.ruby-lsp" ] } diff --git a/Gemfile b/Gemfile index ca0e773e..8e9f845e 100644 --- a/Gemfile +++ b/Gemfile @@ -20,30 +20,30 @@ group :development do gem "json", '= 2.6.1', require: false if Gem::Requirement.create(['>= 3.1.0', '< 3.1.3']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) gem "json", '= 2.6.3', require: false if Gem::Requirement.create(['>= 3.2.0', '< 4.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) gem "racc", '~> 1.4.0', require: false if Gem::Requirement.create(['>= 2.7.0', '< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) + gem "deep_merge", '~> 1.2.2', require: false gem "voxpupuli-puppet-lint-plugins", '~> 5.0', require: false - gem "facterdb", '~> 1.18', require: false - gem "metadata-json-lint", '~> 3.0', require: false - gem "puppetlabs_spec_helper", '~> 6.0', require: false - gem "rspec-puppet-facts", '~> 2.0', require: false - gem "codecov", '~> 0.2', require: false + gem "facterdb", '~> 2.1', require: false + gem "metadata-json-lint", '~> 4.0', require: false + gem "rspec-puppet-facts", '~> 4.0', require: false gem "dependency_checker", '~> 1.0.0', require: false gem "parallel_tests", '= 3.12.1', require: false gem "pry", '~> 0.10', require: false - gem "simplecov-console", '~> 0.5', require: false + gem "simplecov-console", '~> 0.9', require: false gem "puppet-debugger", '~> 1.0', require: false - gem "rubocop", '= 1.48.1', require: false + gem "rubocop", '~> 1.50.0', require: false gem "rubocop-performance", '= 1.16.0', require: false gem "rubocop-rspec", '= 2.19.0', require: false - gem "puppet-strings", '~> 4.0', require: false gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw] + gem "rexml", '>= 3.0.0', '< 3.2.7', require: false end -group :system_tests do - gem "puppet_litmus", '~> 1.0', require: false, platforms: [:ruby, :x64_mingw] - gem "serverspec", '~> 2.41', require: false -end -group :release_prep do +group :development, :release_prep do gem "puppet-strings", '~> 4.0', require: false - gem "puppetlabs_spec_helper", '~> 6.0', require: false + gem "puppetlabs_spec_helper", '~> 7.0', require: false +end +group :system_tests do + gem "puppet_litmus", '~> 1.0', require: false, platforms: [:ruby, :x64_mingw] + gem "CFPropertyList", '< 3.0.7', require: false, platforms: [:mswin, :mingw, :x64_mingw] + gem "serverspec", '~> 2.41', require: false end puppet_version = ENV['PUPPET_GEM_VERSION'] diff --git a/metadata.json b/metadata.json index 8fe1c175..f51a3627 100644 --- a/metadata.json +++ b/metadata.json @@ -82,6 +82,6 @@ } ], "template-url": "https://github.com/puppetlabs/pdk-templates.git#main", - "template-ref": "heads/main-0-g79a2f93", - "pdk-version": "3.0.0" + "template-ref": "tags/3.2.0.4-0-g5d17ec1", + "pdk-version": "3.2.0" } diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 6820cebe..ae7c1f68 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -25,7 +25,8 @@ next unless File.exist?(f) && File.readable?(f) && File.size?(f) begin - default_facts.merge!(YAML.safe_load(File.read(f), permitted_classes: [], permitted_symbols: [], aliases: true)) + require 'deep_merge' + default_facts.deep_merge!(YAML.safe_load(File.read(f), permitted_classes: [], permitted_symbols: [], aliases: true)) rescue StandardError => e RSpec.configuration.reporter.message "WARNING: Unable to load #{f}: #{e}" end @@ -33,7 +34,7 @@ # read default_facts and merge them over what is provided by facterdb default_facts.each do |fact, value| - add_custom_fact fact, value + add_custom_fact fact, value, merge_facts: true end RSpec.configure do |c| From 2478e842dbd1823275259c7b59b67094b27434a5 Mon Sep 17 00:00:00 2001 From: Saurabh Pandit Date: Thu, 3 Oct 2024 13:54:18 +0530 Subject: [PATCH 17/37] (CAT-2051): Fixed SUSEConnect command so that java installation succeeds on SLES-15 --- manifests/init.pp | 9 ++++----- spec/classes/java_spec.rb | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 78ba209e..31750303 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -110,13 +110,12 @@ default => '--jre' } - # Enable legacy repo to install net-tools-deprecated package - # If SUSE OS major version is >= 15 and minor version is > 3 - if ($facts['os']['family'] in ['SLES', 'SUSE']) and (versioncmp($facts['os']['release']['major'], '15') >= 0 and versioncmp($facts['os']['release']['minor'], '3') == 1) { + # If the OS is SLES >= 15.3, enable the legacy repo to install net-tools-deprecated package + if ($facts['os']['family'] in ['SLES', 'SUSE']) and (versioncmp($facts['os']['release']['full'], '15.3') >= 0) { exec { 'Enable legacy repos': path => '/bin:/usr/bin/:/sbin:/usr/sbin', - command => 'SUSEConnect --product sle-module-legacy/15.5/x86_64', - unless => 'SUSEConnect --status-text | grep sle-module-legacy/15.5/x86_64', + command => "SUSEConnect --product sle-module-legacy/${facts['os']['release']['full']}/x86_64", + unless => "SUSEConnect --status-text | grep sle-module-legacy/${facts['os']['release']['full']}/x86_64", } } diff --git a/spec/classes/java_spec.rb b/spec/classes/java_spec.rb index 9908af9c..90efa9f5 100644 --- a/spec/classes/java_spec.rb +++ b/spec/classes/java_spec.rb @@ -95,7 +95,7 @@ end context 'when selecting default for OpenSUSE 12.3' do - let(:facts) { { os: { family: 'Suse', name: 'OpenSUSE', release: { major: '12.3' }, architecture: 'x86_64' } } } + let(:facts) { { os: { family: 'Suse', name: 'OpenSUSE', release: { full: '12.3', major: '12', minor: '3' }, architecture: 'x86_64' } } } it { is_expected.to contain_package('java').with_name('java-1_7_0-openjdk-devel') } it { is_expected.to contain_file_line('java-home-environment').with_line('JAVA_HOME=/usr/lib64/jvm/java-1.7.0-openjdk-1.7.0/') } From d80911b89e264a8dbf724bd997335003e7078803 Mon Sep 17 00:00:00 2001 From: Saurabh Pandit Date: Tue, 1 Oct 2024 17:17:39 +0530 Subject: [PATCH 18/37] (CAT-2051): Exclude Debian-12-arm64 platform --- .github/workflows/nightly.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index ebbaa7ff..617decd9 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -16,4 +16,4 @@ jobs: secrets: "inherit" with: runs_on: "ubuntu-20.04" - flags: "--exclude-platforms '[\"Ubuntu-22.04-arm\", \"RedHat-9-arm\"]'" + flags: "--exclude-platforms '[\"Ubuntu-22.04-arm\", \"RedHat-9-arm\", \"Debian-12-arm\"]'" From 9ec03b23997d9931d30037f7a5fd6c43f87e6129 Mon Sep 17 00:00:00 2001 From: Saurabh Pandit Date: Thu, 3 Oct 2024 18:51:29 +0530 Subject: [PATCH 19/37] (CAT-2051): Excluded debian-12-arm from ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 87458beb..c4838ff5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,4 +17,4 @@ jobs: secrets: "inherit" with: runs_on: "ubuntu-20.04" - flags: "--exclude-platforms '[\"Ubuntu-22.04-arm\", \"RedHat-9-arm\"]'" + flags: "--exclude-platforms '[\"Ubuntu-22.04-arm\", \"RedHat-9-arm\", \"Debian-12-arm\"]'" From b1e88b2b17e90c95ce77ddebc33063f4296eeafa Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Mon, 7 Oct 2024 10:47:14 +0000 Subject: [PATCH 20/37] Release prep v11.0.1 --- CHANGELOG.md | 22 +++++++++++++++++++--- metadata.json | 2 +- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8cb6b800..90f07579 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,11 +5,20 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org). -## [v11.0.0](https://github.com/puppetlabs/puppetlabs-java/tree/v11.0.0) - 2024-04-15 +## [v11.0.1](https://github.com/puppetlabs/puppetlabs-java/tree/v11.0.1) - 2024-10-07 + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v11.0.0...v11.0.1) + +### Fixed + +- (CAT-2051): Fixed SUSEConnect command so that java installation succeeds on SLES-15 [#601](https://github.com/puppetlabs/puppetlabs-java/pull/601) ([span786](https://github.com/span786)) + +## [v11.0.0](https://github.com/puppetlabs/puppetlabs-java/tree/v11.0.0) - 2024-04-16 [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v10.1.2...v11.0.0) ### Changed + - [CAT-1427] : Removing RedHat/Scientific/OracleLinux 6 [#576](https://github.com/puppetlabs/puppetlabs-java/pull/576) ([rajat-puppet](https://github.com/rajat-puppet)) ### Added @@ -42,6 +51,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v9.0.1...v10.0.0) ### Changed + - (CONT-784) Add Support for Puppet 8 / Drop Support for Puppet 6 [#548](https://github.com/puppetlabs/puppetlabs-java/pull/548) ([david22swan](https://github.com/david22swan)) ### Added @@ -66,6 +76,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v8.2.0...v9.0.0) ### Changed + - (CONT-263) Update minimum required puppet version [#535](https://github.com/puppetlabs/puppetlabs-java/pull/535) ([LukasAud](https://github.com/LukasAud)) ### Fixed @@ -99,6 +110,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v7.3.0...v8.0.0) ### Changed + - (GH-C&T-7) Remove code specific to unsupported OSs [#507](https://github.com/puppetlabs/puppetlabs-java/pull/507) ([david22swan](https://github.com/david22swan)) ### Added @@ -172,6 +184,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v6.5.0...v7.0.0) ### Changed + - pdksync - Remove Puppet 5 from testing and bump minimal version to 6.0.0 [#463](https://github.com/puppetlabs/puppetlabs-java/pull/463) ([carabasdaniel](https://github.com/carabasdaniel)) ### Fixed @@ -247,6 +260,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v4.1.0...v5.0.0) ### Changed + - [FM-8320] Remove Oracle download [#372](https://github.com/puppetlabs/puppetlabs-java/pull/372) ([carabasdaniel](https://github.com/carabasdaniel)) ### Added @@ -273,6 +287,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/3.3.0...v4.0.0) ### Changed + - pdksync - (MODULES-8444) - Raise lower Puppet bound [#356](https://github.com/puppetlabs/puppetlabs-java/pull/356) ([david22swan](https://github.com/david22swan)) ### Added @@ -328,6 +343,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/2.4.0...3.0.0) ### Changed + - [FM-6963] Removal of unsupported OS from java [#295](https://github.com/puppetlabs/puppetlabs-java/pull/295) ([david22swan](https://github.com/david22swan)) ### Added @@ -415,7 +431,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ### Fixed - Fix typo in documentation for class oracle [#170](https://github.com/puppetlabs/puppetlabs-java/pull/170) ([gerhardsam](https://github.com/gerhardsam)) -- Fix up rspec deprecation warnings. [#166](https://github.com/puppetlabs/puppetlabs-java/pull/166) ([alexharv074](https://github.com/alexharv074)) +- Fix up rspec deprecation warnings. [#166](https://github.com/puppetlabs/puppetlabs-java/pull/166) ([alex-harvey-z3q](https://github.com/alex-harvey-z3q)) ## [1.5.0](https://github.com/puppetlabs/puppetlabs-java/tree/1.5.0) - 2016-04-12 @@ -431,7 +447,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ### Fixed -- Fix typo in README.markdown [#165](https://github.com/puppetlabs/puppetlabs-java/pull/165) ([alexharv074](https://github.com/alexharv074)) +- Fix typo in README.markdown [#165](https://github.com/puppetlabs/puppetlabs-java/pull/165) ([alex-harvey-z3q](https://github.com/alex-harvey-z3q)) ## [1.4.3](https://github.com/puppetlabs/puppetlabs-java/tree/1.4.3) - 2015-12-07 diff --git a/metadata.json b/metadata.json index 8fe1c175..a4ea3424 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "puppetlabs-java", - "version": "11.0.0", + "version": "11.0.1", "author": "puppetlabs", "summary": "Installs the correct Java package on various platforms.", "license": "Apache-2.0", From bc3fd6352bca16c61b16fa059c9840e3f0ab8d75 Mon Sep 17 00:00:00 2001 From: Amit Karsale Date: Mon, 18 Nov 2024 09:52:46 +0530 Subject: [PATCH 21/37] (CAT-2158) Upgrade rexml to address CVE-2024-49761 --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 8e9f845e..2d8e1608 100644 --- a/Gemfile +++ b/Gemfile @@ -34,7 +34,7 @@ group :development do gem "rubocop-performance", '= 1.16.0', require: false gem "rubocop-rspec", '= 2.19.0', require: false gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw] - gem "rexml", '>= 3.0.0', '< 3.2.7', require: false + gem "rexml", '>= 3.3.9', require: false end group :development, :release_prep do gem "puppet-strings", '~> 4.0', require: false From 5db785fd6a4899d5d0fa863b58d50fd1d8cac9c4 Mon Sep 17 00:00:00 2001 From: John Cooper Date: Wed, 2 Oct 2024 17:04:28 +0100 Subject: [PATCH 22/37] Add support for Ubuntu 24.04 This adds the same settings for Debian 12. While Ubuntu has v21 of openjdk available it uses the more conservative v17 --- manifests/params.pp | 2 +- metadata.json | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/manifests/params.pp b/manifests/params.pp index a301347f..708d3e6f 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -58,7 +58,7 @@ default => $facts['os']['architecture'] } case $facts['os']['release']['major'] { - '12': { + '12', '24.04': { $openjdk = 17 } '10', '11', '18.04', '18.10', '19.04', '19.10', '20.04', '22.04': { diff --git a/metadata.json b/metadata.json index 5348561e..7a2b4144 100644 --- a/metadata.json +++ b/metadata.json @@ -52,7 +52,8 @@ "operatingsystemrelease": [ "18.04", "20.04", - "22.04" + "22.04", + "24.04" ] }, { From c1e0299cd68c091aab9e4b7405249ed7f2d4dc41 Mon Sep 17 00:00:00 2001 From: John Cooper Date: Fri, 8 Nov 2024 15:51:35 +0000 Subject: [PATCH 23/37] Don't test on ubuntu 24.04 for arm --- .github/workflows/ci.yml | 3 +-- .github/workflows/nightly.yml | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5c98157b..a4cc7b9d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,5 +17,4 @@ jobs: secrets: "inherit" with: runs_on: "ubuntu-20.04" - flags: "--exclude-platforms '[\"Ubuntu-22.04-arm\", \"RedHat-9-arm\", \"Debian-12-arm\"]'" - + flags: "--exclude-platforms '[\"Ubuntu-24.04-arm\", \"Ubuntu-22.04-arm\", \"RedHat-9-arm\", \"Debian-12-arm\"]'" diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 963e6290..85d2bd8f 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -16,5 +16,4 @@ jobs: secrets: "inherit" with: runs_on: "ubuntu-20.04" - flags: "--exclude-platforms '[\"Ubuntu-22.04-arm\", \"RedHat-9-arm\", \"Debian-12-arm\"]'" - + flags: "--exclude-platforms '[\"Ubuntu-24.04-arm\", \"Ubuntu-22.04-arm\", \"RedHat-9-arm\", \"Debian-12-arm\"]'" From 73535ee0592ac052ee977834f3f0a0cb36baa246 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Tue, 17 Dec 2024 05:18:15 +0000 Subject: [PATCH 24/37] Release prep v11.1.0 --- CHANGELOG.md | 12 ++++++++++++ metadata.json | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 90f07579..4b956617 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,18 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org). +## [v11.1.0](https://github.com/puppetlabs/puppetlabs-java/tree/v11.1.0) - 2024-12-17 + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v11.0.1...v11.1.0) + +### Fixed + +- (CAT-2158) Upgrade rexml to address CVE-2024-49761 [#605](https://github.com/puppetlabs/puppetlabs-java/pull/605) ([amitkarsale](https://github.com/amitkarsale)) + +### Other + +- Add support for Ubuntu 24.04 [#600](https://github.com/puppetlabs/puppetlabs-java/pull/600) ([choffee](https://github.com/choffee)) + ## [v11.0.1](https://github.com/puppetlabs/puppetlabs-java/tree/v11.0.1) - 2024-10-07 [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v11.0.0...v11.0.1) diff --git a/metadata.json b/metadata.json index 7a2b4144..cdb368e8 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "puppetlabs-java", - "version": "11.0.1", + "version": "11.1.0", "author": "puppetlabs", "summary": "Installs the correct Java package on various platforms.", "license": "Apache-2.0", From f258e16451816587f29193175b5310761e5434a5 Mon Sep 17 00:00:00 2001 From: Shubham Shinde Date: Tue, 22 Apr 2025 13:53:14 +0530 Subject: [PATCH 25/37] (CAT-2296) Update github runner image to ubuntu-24.04 ubuntu-20.04 is not supported anymore: https://github.com/actions/runner-images/issues/11101 --- .github/workflows/ci.yml | 2 +- .github/workflows/nightly.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a4cc7b9d..969d3b8b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,5 +16,5 @@ jobs: uses: "puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main" secrets: "inherit" with: - runs_on: "ubuntu-20.04" + runs_on: "ubuntu-24.04" flags: "--exclude-platforms '[\"Ubuntu-24.04-arm\", \"Ubuntu-22.04-arm\", \"RedHat-9-arm\", \"Debian-12-arm\"]'" diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 85d2bd8f..63df8c47 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -15,5 +15,5 @@ jobs: uses: "puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main" secrets: "inherit" with: - runs_on: "ubuntu-20.04" + runs_on: "ubuntu-24.04" flags: "--exclude-platforms '[\"Ubuntu-24.04-arm\", \"Ubuntu-22.04-arm\", \"RedHat-9-arm\", \"Debian-12-arm\"]'" From 61013d78b9e88407554a7e071b9f993af9b06bd6 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Fri, 18 Jul 2025 13:18:03 +0200 Subject: [PATCH 26/37] puppet/archive: Allow 8.x Signed-off-by: Evgeni Golov --- metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.json b/metadata.json index cdb368e8..45aed58a 100644 --- a/metadata.json +++ b/metadata.json @@ -14,7 +14,7 @@ }, { "name": "puppet/archive", - "version_requirement": ">= 1.1.0 < 8.0.0" + "version_requirement": ">= 1.1.0 < 9.0.0" } ], "operatingsystem_support": [ From 67cee367190470397a220d1cd1fb1c694839719c Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Fri, 18 Jul 2025 11:23:01 +0000 Subject: [PATCH 27/37] Release prep v11.2.0 --- CHANGELOG.md | 9 +++++++++ metadata.json | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b956617..c92ee508 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org). +## [v11.2.0](https://github.com/puppetlabs/puppetlabs-java/tree/v11.2.0) - 2025-07-18 + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v11.1.0...v11.2.0) + +### Other + +- puppet/archive: Allow 8.x [#611](https://github.com/puppetlabs/puppetlabs-java/pull/611) ([evgeni](https://github.com/evgeni)) +- (CAT-2296) Update github runner image to ubuntu-24.04 [#610](https://github.com/puppetlabs/puppetlabs-java/pull/610) ([shubhamshinde360](https://github.com/shubhamshinde360)) + ## [v11.1.0](https://github.com/puppetlabs/puppetlabs-java/tree/v11.1.0) - 2024-12-17 [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v11.0.1...v11.1.0) diff --git a/metadata.json b/metadata.json index 45aed58a..40bd8099 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "puppetlabs-java", - "version": "11.1.0", + "version": "11.2.0", "author": "puppetlabs", "summary": "Installs the correct Java package on various platforms.", "license": "Apache-2.0", From d8ef8279d2231390bb71d556a58591e0f72bec02 Mon Sep 17 00:00:00 2001 From: Lukas Audzevicius Date: Thu, 11 Sep 2025 14:15:28 +0100 Subject: [PATCH 28/37] (CAT-2376) Puppetcore update A set of changes dedicated to implementing puppetcore into our modules. This update, amongst other changes, removes Puppet 7 support. --- metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.json b/metadata.json index 40bd8099..77631c6c 100644 --- a/metadata.json +++ b/metadata.json @@ -79,7 +79,7 @@ "requirements": [ { "name": "puppet", - "version_requirement": ">= 7.0.0 < 9.0.0" + "version_requirement": ">= 8.0.0 < 9.0.0" } ], "template-url": "https://github.com/puppetlabs/pdk-templates.git#main", From ed4fc3cc0991ebb46c6a7236feb170fb0f2fad45 Mon Sep 17 00:00:00 2001 From: Lukas Audzevicius Date: Thu, 11 Sep 2025 14:18:10 +0100 Subject: [PATCH 29/37] PDK update --- .github/workflows/ci.yml | 3 -- .github/workflows/nightly.yml | 3 -- .puppet-lint.rc | 8 ++++ .rubocop.yml | 2 +- Gemfile | 89 ++++++++++++++++++++++------------- Rakefile | 9 ++++ metadata.json | 4 +- 7 files changed, 76 insertions(+), 42 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 969d3b8b..a5738adb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,6 +15,3 @@ jobs: needs: Spec uses: "puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main" secrets: "inherit" - with: - runs_on: "ubuntu-24.04" - flags: "--exclude-platforms '[\"Ubuntu-24.04-arm\", \"Ubuntu-22.04-arm\", \"RedHat-9-arm\", \"Debian-12-arm\"]'" diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 63df8c47..1b06c471 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -14,6 +14,3 @@ jobs: needs: Spec uses: "puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main" secrets: "inherit" - with: - runs_on: "ubuntu-24.04" - flags: "--exclude-platforms '[\"Ubuntu-24.04-arm\", \"Ubuntu-22.04-arm\", \"RedHat-9-arm\", \"Debian-12-arm\"]'" diff --git a/.puppet-lint.rc b/.puppet-lint.rc index cc96ece0..9e15c6e0 100644 --- a/.puppet-lint.rc +++ b/.puppet-lint.rc @@ -1 +1,9 @@ +--fail-on-warnings --relative +--no-80chars-check +--no-140chars-check +--no-class_inherits_from_params_class-check +--no-autoloader_layout-check +--no-documentation-check +--no-single_quote_string_with_variables-check +--ignore-paths=.vendor/**/*.pp,.bundle/**/*.pp,pkg/**/*.pp,spec/**/*.pp,tests/**/*.pp,types/**/*.pp,vendor/**/*.pp diff --git a/.rubocop.yml b/.rubocop.yml index 439ea84e..47b1aadb 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -5,7 +5,7 @@ require: AllCops: NewCops: enable DisplayCopNames: true - TargetRubyVersion: '2.6' + TargetRubyVersion: 3.1 Include: - "**/*.rb" Exclude: diff --git a/Gemfile b/Gemfile index 2d8e1608..4e7de031 100644 --- a/Gemfile +++ b/Gemfile @@ -1,65 +1,86 @@ -source ENV['GEM_SOURCE'] || 'https://rubygems.org' +# frozen_string_literal: true -def location_for(place_or_version, fake_version = nil) - git_url_regex = %r{\A(?(https?|git)[:@][^#]*)(#(?.*))?} - file_url_regex = %r{\Afile:\/\/(?.*)} +# For puppetcore, set GEM_SOURCE_PUPPETCORE = 'https://rubygems-puppetcore.puppet.com' +gemsource_default = ENV['GEM_SOURCE'] || 'https://rubygems.org' +gemsource_puppetcore = if ENV['PUPPET_FORGE_TOKEN'] + 'https://rubygems-puppetcore.puppet.com' +else + ENV['GEM_SOURCE_PUPPETCORE'] || gemsource_default +end +source gemsource_default + +def location_for(place_or_constraint, fake_constraint = nil, opts = {}) + git_url_regex = /\A(?(?:https?|git)[:@][^#]*)(?:#(?.*))?/ + file_url_regex = %r{\Afile://(?.*)} + + if place_or_constraint && (git_url = place_or_constraint.match(git_url_regex)) + # Git source → ignore :source, keep fake_constraint + [fake_constraint, { git: git_url[:url], branch: git_url[:branch], require: false }].compact + + elsif place_or_constraint && (file_url = place_or_constraint.match(file_url_regex)) + # File source → ignore :source, keep fake_constraint or default >= 0 + [fake_constraint || '>= 0', { path: File.expand_path(file_url[:path]), require: false }] - if place_or_version && (git_url = place_or_version.match(git_url_regex)) - [fake_version, { git: git_url[:url], branch: git_url[:branch], require: false }].compact - elsif place_or_version && (file_url = place_or_version.match(file_url_regex)) - ['>= 0', { path: File.expand_path(file_url[:path]), require: false }] else - [place_or_version, { require: false }] + # Plain version constraint → merge opts (including :source if provided) + [place_or_constraint, { require: false }.merge(opts)] + end +end + +# Print debug information if DEBUG_GEMS or VERBOSE is set +def print_gem_statement_for(gems) + puts 'DEBUG: Gem definitions that will be generated:' + gems.each do |gem_name, gem_params| + puts "DEBUG: gem #{([gem_name.inspect] + gem_params.map(&:inspect)).join(', ')}" end end group :development do - gem "json", '= 2.1.0', require: false if Gem::Requirement.create(['>= 2.5.0', '< 2.7.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) - gem "json", '= 2.3.0', require: false if Gem::Requirement.create(['>= 2.7.0', '< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) - gem "json", '= 2.5.1', require: false if Gem::Requirement.create(['>= 3.0.0', '< 3.0.5']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) gem "json", '= 2.6.1', require: false if Gem::Requirement.create(['>= 3.1.0', '< 3.1.3']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) gem "json", '= 2.6.3', require: false if Gem::Requirement.create(['>= 3.2.0', '< 4.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) gem "racc", '~> 1.4.0', require: false if Gem::Requirement.create(['>= 2.7.0', '< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) gem "deep_merge", '~> 1.2.2', require: false gem "voxpupuli-puppet-lint-plugins", '~> 5.0', require: false - gem "facterdb", '~> 2.1', require: false + gem "facterdb", '~> 2.1', require: false if Gem::Requirement.create(['< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) + gem "facterdb", '~> 3.0', require: false if Gem::Requirement.create(['>= 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) gem "metadata-json-lint", '~> 4.0', require: false - gem "rspec-puppet-facts", '~> 4.0', require: false + gem "json-schema", '< 5.1.1', require: false + gem "rspec-puppet-facts", '~> 4.0', require: false if Gem::Requirement.create(['< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) + gem "rspec-puppet-facts", '~> 5.0', require: false if Gem::Requirement.create(['>= 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) gem "dependency_checker", '~> 1.0.0', require: false gem "parallel_tests", '= 3.12.1', require: false gem "pry", '~> 0.10', require: false gem "simplecov-console", '~> 0.9', require: false - gem "puppet-debugger", '~> 1.0', require: false + gem "puppet-debugger", '~> 1.6', require: false gem "rubocop", '~> 1.50.0', require: false gem "rubocop-performance", '= 1.16.0', require: false gem "rubocop-rspec", '= 2.19.0', require: false gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw] - gem "rexml", '>= 3.3.9', require: false + gem "bigdecimal", '< 3.2.2', require: false, platforms: [:mswin, :mingw, :x64_mingw] end group :development, :release_prep do gem "puppet-strings", '~> 4.0', require: false - gem "puppetlabs_spec_helper", '~> 7.0', require: false + gem "puppetlabs_spec_helper", '~> 8.0', require: false + gem "puppet-blacksmith", '~> 7.0', require: false end group :system_tests do - gem "puppet_litmus", '~> 1.0', require: false, platforms: [:ruby, :x64_mingw] + gem "puppet_litmus", '~> 2.0', require: false, platforms: [:ruby, :x64_mingw] if !ENV['PUPPET_FORGE_TOKEN'].to_s.empty? + gem "puppet_litmus", '~> 1.0', require: false, platforms: [:ruby, :x64_mingw] if ENV['PUPPET_FORGE_TOKEN'].to_s.empty? gem "CFPropertyList", '< 3.0.7', require: false, platforms: [:mswin, :mingw, :x64_mingw] gem "serverspec", '~> 2.41', require: false end -puppet_version = ENV['PUPPET_GEM_VERSION'] -facter_version = ENV['FACTER_GEM_VERSION'] -hiera_version = ENV['HIERA_GEM_VERSION'] - gems = {} +puppet_version = ENV.fetch('PUPPET_GEM_VERSION', nil) +facter_version = ENV.fetch('FACTER_GEM_VERSION', nil) +hiera_version = ENV.fetch('HIERA_GEM_VERSION', nil) -gems['puppet'] = location_for(puppet_version) - -# If facter or hiera versions have been specified via the environment -# variables - -gems['facter'] = location_for(facter_version) if facter_version -gems['hiera'] = location_for(hiera_version) if hiera_version +gems['puppet'] = location_for(puppet_version, nil, { source: gemsource_puppetcore }) +gems['facter'] = location_for(facter_version, nil, { source: gemsource_puppetcore }) +gems['hiera'] = location_for(hiera_version, nil, {}) if hiera_version +# Generate the gem definitions +print_gem_statement_for(gems) if ENV['DEBUG'] gems.each do |gem_name, gem_params| gem gem_name, *gem_params end @@ -67,12 +88,14 @@ end # Evaluate Gemfile.local and ~/.gemfile if they exist extra_gemfiles = [ "#{__FILE__}.local", - File.join(Dir.home, '.gemfile'), + File.join(Dir.home, '.gemfile') ] extra_gemfiles.each do |gemfile| - if File.file?(gemfile) && File.readable?(gemfile) - eval(File.read(gemfile), binding) - end + next unless File.file?(gemfile) && File.readable?(gemfile) + + # rubocop:disable Security/Eval + eval(File.read(gemfile), binding) + # rubocop:enable Security/Eval end # vim: syntax=ruby diff --git a/Rakefile b/Rakefile index 77590fe6..31b59305 100644 --- a/Rakefile +++ b/Rakefile @@ -7,3 +7,12 @@ require 'puppet-syntax/tasks/puppet-syntax' require 'puppet-strings/tasks' if Gem.loaded_specs.key? 'puppet-strings' PuppetLint.configuration.send('disable_relative') +PuppetLint.configuration.send('disable_80chars') +PuppetLint.configuration.send('disable_140chars') +PuppetLint.configuration.send('disable_class_inherits_from_params_class') +PuppetLint.configuration.send('disable_autoloader_layout') +PuppetLint.configuration.send('disable_documentation') +PuppetLint.configuration.send('disable_single_quote_string_with_variables') +PuppetLint.configuration.fail_on_warnings = true +PuppetLint.configuration.ignore_paths = [".vendor/**/*.pp", ".bundle/**/*.pp", "pkg/**/*.pp", "spec/**/*.pp", "tests/**/*.pp", "types/**/*.pp", "vendor/**/*.pp"] + diff --git a/metadata.json b/metadata.json index 77631c6c..075338b3 100644 --- a/metadata.json +++ b/metadata.json @@ -83,6 +83,6 @@ } ], "template-url": "https://github.com/puppetlabs/pdk-templates.git#main", - "template-ref": "tags/3.2.0.4-0-g5d17ec1", - "pdk-version": "3.2.0" + "template-ref": "tags/3.5.1-0-g9d5b193", + "pdk-version": "3.5.0" } From 100a54bb653e2fa3fe223c6959a8bf557fee10ae Mon Sep 17 00:00:00 2001 From: Lukas Audzevicius Date: Thu, 11 Sep 2025 14:18:48 +0100 Subject: [PATCH 30/37] Rubocop safe autocorrections --- spec/defines/download_spec.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/spec/defines/download_spec.rb b/spec/defines/download_spec.rb index c6b8e7a6..b7b288bd 100644 --- a/spec/defines/download_spec.rb +++ b/spec/defines/download_spec.rb @@ -15,7 +15,7 @@ version_major: '8u201', version_minor: 'b09', java_se: 'jdk', - url: url + url: } end let(:title) { 'jdk8' } @@ -50,7 +50,7 @@ basedir: '/usr/java', manage_symlink: true, symlink_name: 'java_home', - url: url + url: } end let(:title) { 'jdk6' } @@ -65,7 +65,7 @@ version: '6', java_se: 'jdk', basedir: '/usr/java', - url: url + url: } end let(:title) { 'jdk6_nosymlink' } @@ -78,7 +78,7 @@ let(:facts) { { kernel: 'Linux', os: { family: 'Debian', architecture: 'amd64', name: 'Ubuntu', release: { full: '18.04' } } } } context 'when passing URL to url parameter' do - let(:params) { { ensure: 'present', version_major: '8u201', version_minor: 'b09', java_se: 'jdk', url: url } } + let(:params) { { ensure: 'present', version_major: '8u201', version_minor: 'b09', java_se: 'jdk', url: } } let(:title) { 'jdk8' } it { is_expected.to contain_archive('/tmp/jdk-8-8u201-b09-linux-x64.tar.gz') } @@ -89,7 +89,7 @@ let(:facts) { { kernel: 'Linux', os: { family: 'Debian', architecture: 'amd64', name: 'Debian', release: { full: '10.0' } } } } context 'when passing URL to url parameter' do - let(:params) { { ensure: 'present', version_major: '8u201', version_minor: 'b09', java_se: 'jdk', url: url } } + let(:params) { { ensure: 'present', version_major: '8u201', version_minor: 'b09', java_se: 'jdk', url: } } let(:title) { 'jdk8' } it { is_expected.to contain_archive('/tmp/jdk-8-8u201-b09-linux-x64.tar.gz') } From 6b4d182a2f9d84cb0bc4ffc9c930a711e4ebede9 Mon Sep 17 00:00:00 2001 From: Lukas Audzevicius Date: Thu, 11 Sep 2025 14:19:43 +0100 Subject: [PATCH 31/37] Test against nightlies --- .github/workflows/ci.yml | 2 ++ .github/workflows/nightly.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a5738adb..2cdfc30f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,4 +14,6 @@ jobs: Acceptance: needs: Spec uses: "puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main" + with: + flags: "--nightly" secrets: "inherit" diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 1b06c471..5a39a47c 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -13,4 +13,6 @@ jobs: Acceptance: needs: Spec uses: "puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main" + with: + flags: "--nightly" secrets: "inherit" From 3b851b66280852b8788dc4c7c3a7b67dd0548b1f Mon Sep 17 00:00:00 2001 From: Lukas Audzevicius Date: Wed, 21 Jan 2026 10:48:00 +0000 Subject: [PATCH 32/37] (CAT-2511) Address sles box misconfigurations Addressing misconfigurations in the SLES box to ensure proper setup for CI. --- manifests/init.pp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 31750303..ce5dcb9a 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -110,13 +110,17 @@ default => '--jre' } - # If the OS is SLES >= 15.3, enable the legacy repo to install net-tools-deprecated package - if ($facts['os']['family'] in ['SLES', 'SUSE']) and (versioncmp($facts['os']['release']['full'], '15.3') >= 0) { - exec { 'Enable legacy repos': - path => '/bin:/usr/bin/:/sbin:/usr/sbin', - command => "SUSEConnect --product sle-module-legacy/${facts['os']['release']['full']}/x86_64", - unless => "SUSEConnect --status-text | grep sle-module-legacy/${facts['os']['release']['full']}/x86_64", + # TEMPORARY FIX: If no repos are configured on SLES, add openSUSE Leap as fallback + # This workaround is needed because GCP-provisioned SLES images are unregistered BYOS + # without any package repositories configured. Remove this once proper PAYG images are used. + if ($facts['os']['family'] in ['SLES', 'SUSE']) { + exec { 'Configure zypper repo for SLES': + path => '/bin:/usr/bin:/sbin:/usr/sbin', + command => 'zypper --non-interactive --gpg-auto-import-keys ar http://download.opensuse.org/distribution/leap/15.6/repo/oss/ opensuse-leap-fallback && zypper --non-interactive --gpg-auto-import-keys refresh', + unless => "zypper lr 2>/dev/null | grep -q 'opensuse-leap-fallback\\|http'", + logoutput => true, } + -> Package['java'] } if $facts['os']['family'] == 'Debian' { From bf9d853fabec6c6f00b3798b7cbe0637c87f6081 Mon Sep 17 00:00:00 2001 From: Lukas Audzevicius Date: Tue, 3 Feb 2026 12:02:41 +0000 Subject: [PATCH 33/37] Re-implementing mistakenly removed ARM exclusion --- .github/workflows/ci.yml | 2 +- .github/workflows/nightly.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2cdfc30f..c236bbc2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,5 +15,5 @@ jobs: needs: Spec uses: "puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main" with: - flags: "--nightly" + flags: "--nightly --arch-exclude arm" secrets: "inherit" diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 5a39a47c..9f20eccd 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -14,5 +14,5 @@ jobs: needs: Spec uses: "puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main" with: - flags: "--nightly" + flags: "--nightly --arch-exclude arm" secrets: "inherit" From 44e649c1ebf6df36bfa1f53df58f5e42a1dc8d29 Mon Sep 17 00:00:00 2001 From: Jason St-Cyr Date: Wed, 25 Feb 2026 19:37:27 -0500 Subject: [PATCH 34/37] Update link to Puppet modules contributing documentation --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e7a3a7c3..25bf5ebc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,3 +1,3 @@ # Contributing to Puppet modules -Check out our [Contributing to Supported Modules Blog Post](https://puppetlabs.github.io/iac/docs/contributing_to_a_module.html) to find all the information that you will need. +Check out our [Contributing to Puppet modules docs](https://help.puppet.com/core//current/Content/PuppetCore/contributing.htm) to find all the information that you will need. From d7d5ee43c93bd5cf69f568181ab443e0d2e86e33 Mon Sep 17 00:00:00 2001 From: skyamgarp <130442619+skyamgarp@users.noreply.github.com> Date: Tue, 19 Nov 2024 18:11:40 +0530 Subject: [PATCH 35/37] (CAT-2152) Add support for Centos9 --- metadata.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/metadata.json b/metadata.json index 075338b3..81a4315e 100644 --- a/metadata.json +++ b/metadata.json @@ -30,7 +30,8 @@ "operatingsystem": "CentOS", "operatingsystemrelease": [ "7", - "8" + "8", + "9" ] }, { From 2ab45cedf3f64993d6fe1ef1a84a03d8fce2143c Mon Sep 17 00:00:00 2001 From: "mend-for-github-com[bot]" <50673670+mend-for-github-com[bot]@users.noreply.github.com> Date: Tue, 4 Feb 2025 02:03:30 +0000 Subject: [PATCH 36/37] Add .whitesource configuration file --- .whitesource | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .whitesource diff --git a/.whitesource b/.whitesource new file mode 100644 index 00000000..04109aad --- /dev/null +++ b/.whitesource @@ -0,0 +1,45 @@ +{ + "scanSettings": { + "configMode": "AUTO", + "configExternalURL": "", + "projectToken": "", + "baseBranches": [] + }, + "scanSettingsSAST": { + "enableScan": true, + "scanPullRequests": true, + "incrementalScan": true, + "baseBranches": [], + "snippetSize": 10 + }, + "checkRunSettings": { + "vulnerableCheckRunConclusionLevel": "failure", + "displayMode": "diff", + "useMendCheckNames": true + }, + "checkRunSettingsSAST": { + "checkRunConclusionLevel": "failure", + "severityThreshold": "high" + }, + "issueSettings": { + "minSeverityLevel": "LOW", + "issueType": "DEPENDENCY" + }, + "issueSettingsSAST": { + "minSeverityLevel": "high", + "issueType": "repo" + }, + "remediateSettings": { + "workflowRules": { + "enabled": true + } + }, + "imageSettings":{ + "imageTracing":{ + "enableImageTracingPR": false, + "addRepositoryCoordinate": false, + "addDockerfilePath": false, + "addMendIdentifier": false + } + } +} \ No newline at end of file From 7755cc53fdc65a44a49141fa3f50a97ec1d531f8 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Tue, 2 Sep 2025 12:14:35 +0200 Subject: [PATCH 37/37] Add support for Debian 13 (trixie) Debian v13 AKA trixie was released on 2025-08-09 as Debian's new stable release. --- manifests/params.pp | 3 +++ metadata.json | 3 ++- spec/classes/java_spec.rb | 18 ++++++++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/manifests/params.pp b/manifests/params.pp index 708d3e6f..fa352809 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -58,6 +58,9 @@ default => $facts['os']['architecture'] } case $facts['os']['release']['major'] { + '13': { + $openjdk = 21 + } '12', '24.04': { $openjdk = 17 } diff --git a/metadata.json b/metadata.json index 81a4315e..e0db352c 100644 --- a/metadata.json +++ b/metadata.json @@ -45,7 +45,8 @@ "operatingsystemrelease": [ "10", "11", - "12" + "12", + "13" ] }, { diff --git a/spec/classes/java_spec.rb b/spec/classes/java_spec.rb index 90efa9f5..dd51a098 100644 --- a/spec/classes/java_spec.rb +++ b/spec/classes/java_spec.rb @@ -46,6 +46,24 @@ end end + context 'on Debian Trixie (13)' do + let(:facts) { { os: { family: 'Debian', name: 'Debian', lsb: { distcodename: 'trixie' }, release: { major: '13' }, architecture: 'amd64' } } } + + context 'when selecting jdk' do + let(:params) { { 'distribution' => 'jdk' } } + + it { is_expected.to contain_package('java').with_name('openjdk-21-jdk') } + it { is_expected.to contain_file_line('java-home-environment').with_line('JAVA_HOME=/usr/lib/jvm/java-1.21.0-openjdk-amd64/') } + end + + context 'when selecting jre' do + let(:params) { { 'distribution' => 'jre' } } + + it { is_expected.to contain_package('java').with_name('openjdk-21-jre-headless') } + it { is_expected.to contain_file_line('java-home-environment').with_line('JAVA_HOME=/usr/lib/jvm/java-1.21.0-openjdk-amd64/') } + end + end + context 'on Ubuntu Bionic (18.04)' do let(:facts) { { os: { family: 'Debian', name: 'Ubuntu', lsb: { distcodename: 'bionic' }, release: { major: '18.04' }, architecture: 'amd64' } } }