Skip to content

Commit

Permalink
BOR-636: Pull in latest from Facebook (#25)
Browse files Browse the repository at this point in the history
## Description

Pull in latest from Facebook. I'm usually partial to rebase + force
push, but we're doing a merge commit here to preserve more history.

I recommend viewing `git show 452a5bc` (the merge commit).

## Context / Why are we making this change?

To not drift too far from upstream.

## Testing and QA Plan

We should probably do a code review as a group and see if there are any
big changes in recipes we're using. Rollout tbd.

## Impact

Keep our fork close to upstream. Get whatever bugfixes and improvements
from Facebook.
  • Loading branch information
adsr authored Jul 22, 2024
2 parents 99b3e3a + 452a5bc commit 4127c83
Show file tree
Hide file tree
Showing 227 changed files with 2,584 additions and 1,325 deletions.
94 changes: 88 additions & 6 deletions .cookstyle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ AllCops:
# new cops and make upgrades easier (ie not dealing with a bunch of noise
# each Cookstyle update)
DisabledByDefault: true
TargetChefVersion: 13.10.0
TargetChefVersion: 16.18.0

# NOTE: this is also handled in regular RuboCop. T114949895
Lint/Syntax:
Enabled: true

Chef/Correctness/BlockGuardWithOnlyString:
Enabled: true
Expand All @@ -19,6 +23,8 @@ Chef/Correctness/DnfPackageAllowDowngrades:
Enabled: true
Chef/Correctness/IncorrectLibraryInjection:
Enabled: true
Chef/Correctness/InvalidCookbookName:
Enabled: true
Chef/Correctness/InvalidDefaultAction:
Enabled: true
Chef/Correctness/InvalidNotificationTiming:
Expand All @@ -43,8 +49,12 @@ Chef/Correctness/MacosUserdefaultsInvalidType:
Enabled: true
Chef/Correctness/MalformedPlatformValueForPlatformHelper:
Enabled: true
Chef/Correctness/MetadataMalformedDepends:
Enabled: true
Chef/Correctness/MetadataMissingName:
Enabled: true
Chef/Correctness/MetadataMissingVersion:
Enabled: true
Chef/Correctness/NodeNormal:
Enabled: true
Chef/Correctness/NodeNormalUnless:
Expand All @@ -55,6 +65,8 @@ Chef/Correctness/OctalModeAsString:
Enabled: true
Chef/Correctness/OpenSSLPasswordHelpers:
Enabled: true
Chef/Correctness/PowershellFileExists:
Enabled: true
Chef/Correctness/PowershellScriptDeleteFile:
Enabled: true
Chef/Correctness/ResourceSetsInternalProperties:
Expand Down Expand Up @@ -86,6 +98,8 @@ Chef/Deprecations/ChefSpecCoverageReport:
Enabled: true
Chef/Deprecations/ChefSpecLegacyRunner:
Enabled: true
Chef/Deprecations/ChefSugarHelpers:
Enabled: true
Chef/Deprecations/ChefWindowsPlatformHelper:
Enabled: true
Chef/Deprecations/Cheffile:
Expand All @@ -100,10 +114,18 @@ Chef/Deprecations/CookbookDependsOnPoise:
Enabled: true
Chef/Deprecations/CookbooksDependsOnSelf:
Enabled: true
Chef/Deprecations/DependsOnChefNginxCookbook:
Enabled: true
Chef/Deprecations/DependsOnChefReportingCookbook:
Enabled: true
Chef/Deprecations/DependsOnOmnibusUpdaterCookbook:
Enabled: true
Chef/Deprecations/DeprecatedPlatformMethods:
Enabled: true
Chef/Deprecations/DeprecatedShelloutMethods:
Enabled: true
Chef/Deprecations/DeprecatedSudoActions:
Enabled: true
Chef/Deprecations/DeprecatedWindowsVersionCheck:
Enabled: true
Chef/Deprecations/DeprecatedYumRepositoryProperties:
Expand All @@ -120,8 +142,12 @@ Chef/Deprecations/ExecutePathProperty:
Enabled: true
Chef/Deprecations/ExecuteRelativeCreatesWithoutCwd:
Enabled: true
Chef/Deprecations/FoodcriticFile:
Enabled: true
Chef/Deprecations/HWRPWithoutProvides:
Enabled: true
Chef/Deprecations/HWRPWithoutUnifiedTrue:
Enabled: true
Chef/Deprecations/IncludingXMLRubyRecipe:
Enabled: true
Chef/Deprecations/IncludingYumDNFCompatRecipe:
Expand All @@ -137,7 +163,7 @@ Chef/Deprecations/LibrarianChefSpec:
Chef/Deprecations/LocaleDeprecatedLcAllProperty:
Enabled: true
Chef/Deprecations/LogResourceNotifications:
Enabled: true
Enabled: false # TODO(T158851402) ratchet back in
Chef/Deprecations/MacosUserdefaultsGlobalProperty:
Enabled: true
Chef/Deprecations/NamePropertyWithDefaultValue:
Expand All @@ -156,6 +182,8 @@ Chef/Deprecations/PartialSearchHelperUsage:
Enabled: true
Chef/Deprecations/PoiseArchiveUsage:
Enabled: true
Chef/Deprecations/PolicyfileCommunitySource:
Enabled: true
Chef/Deprecations/PowershellCookbookHelpers:
Enabled: true
Chef/Deprecations/RequireRecipe:
Expand Down Expand Up @@ -201,6 +229,27 @@ Chef/Deprecations/WindowsTaskChangeAction:
Chef/Deprecations/WindowsVersionHelpers:
Enabled: true

# These cookbooks don't follow the Effortless Pattern
# See https://docs.chef.io/effortless/
Chef/Effortless/Berksfile:
Enabled: false
Chef/Effortless/ChefVaultUsed:
Enabled: false
Chef/Effortless/CookbookUsesDatabags:
Enabled: false
Chef/Effortless/CookbookUsesEnvironments:
Enabled: false
Chef/Effortless/CookbookUsesPolicygroups:
Enabled: false
Chef/Effortless/CookbookUsesRoles:
Enabled: false
Chef/Effortless/CookbookUsesSearch:
Enabled: false
Chef/Effortless/DependsChefVault:
Enabled: false
Chef/Effortless/SearchForEnvironmentsOrRoles:
Enabled: false

Chef/Modernize/ActionMethodInResource:
Enabled: true
Chef/Modernize/AllowedActionsFromInitialize:
Expand All @@ -217,10 +266,26 @@ Chef/Modernize/CustomResourceWithAttributes:
Enabled: true
Chef/Modernize/DatabagHelpers:
Enabled: true
Chef/Modernize/DeclareActionClass:
Enabled: true
Chef/Modernize/DefaultActionFromInitialize:
Enabled: true
Chef/Modernize/Definitions:
Enabled: true
Chef/Modernize/DependsOnChefVaultCookbook:
Enabled: true
Chef/Modernize/DependsOnChocolateyCookbooks:
Enabled: true
Chef/Modernize/DependsOnKernelModuleCookbook:
Enabled: true
Chef/Modernize/DependsOnLocaleCookbook:
Enabled: true
Chef/Modernize/DependsOnOpensslCookbook:
Enabled: true
Chef/Modernize/DependsOnTimezoneLwrpCookbook:
Enabled: true
Chef/Modernize/DependsOnWindowsFirewallCookbook:
Enabled: true
Chef/Modernize/DependsOnZypperCookbook:
Enabled: true
Chef/Modernize/DslIncludeInResource:
Expand All @@ -237,6 +302,8 @@ Chef/Modernize/ExecuteSysctl:
Enabled: true
Chef/Modernize/ExecuteTzUtil:
Enabled: true
Chef/Modernize/FoodcriticComments:
Enabled: true
Chef/Modernize/IfProvidesDefaultAction:
Enabled: true
Chef/Modernize/IncludingAptDefaultRecipe:
Expand Down Expand Up @@ -295,10 +362,16 @@ Chef/Modernize/SysctlParamResource:
Enabled: true
Chef/Modernize/UnnecessaryDependsChef14:
Enabled: true
Chef/Modernize/UnnecessaryDependsChef15:
Enabled: true
Chef/Modernize/UnnecessaryMixlibShelloutRequire:
Enabled: true
Chef/Modernize/UseBuildEssentialResource:
Enabled: true
Chef/Modernize/UseChefLanguageEnvHelpers:
Enabled: true
Chef/Modernize/UseChefLanguageSystemdHelper:
Enabled: true
Chef/Modernize/UseMultipackageInstalls:
Enabled: true
Chef/Modernize/UseRequireRelative:
Expand Down Expand Up @@ -361,25 +434,34 @@ Chef/RedundantCode/UnnecessaryNameProperty:
Chef/RedundantCode/UseCreateIfMissing:
Enabled: true

Chef/Security/SshPrivateKey:
Enabled: true

Chef/Sharing/DefaultMetadataMaintainer:
Enabled: true
Chef/Sharing/EmptyMetadataField:
Enabled: true
Chef/Sharing/IncludePropertyDescriptions:
Enabled: true
Enabled: false # TODO(T158836638) ratchet back in
Chef/Sharing/IncludeResourceDescriptions:
Enabled: true
Enabled: false # TODO(T158836638) ratchet back in
Chef/Sharing/IncludeResourceExamples:
Enabled: true
Enabled: false # TODO(T158836638) ratchet back in
Chef/Sharing/InsecureCookbookURL:
Enabled: true
Chef/Sharing/InvalidLicenseString:
Enabled: true

Chef/Style/AttributeKeys:
Enabled: true
Chef/Style/ChefWhaaat:
Enabled: false # Turned off intentionally, too opinionated/noisy
Chef/Style/CommentFormat:
Enabled: false # Turned off intentionally, too opinionated/noisy
Chef/Style/CommentSentenceSpacing:
Enabled: true
Enabled: false # Turned off intentionally, too opinionated/noisy
Chef/Style/CopyrightCommentFormat:
Enabled: false # Turned off intentionally, too opinionated/noisy
Chef/Style/DefaultCopyrightComments:
Enabled: true
Chef/Style/FileMode:
Expand Down
5 changes: 5 additions & 0 deletions .cookstyle_combined.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Combine the RuboCop and Cookstyle specific rules here (as opposed to directly
# including .rubocop.yml into .cookstyle.yml)
inherit_from:
- .rubocop.yml
- .cookstyle.yml
18 changes: 8 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: [2.4, 2.5, 2.6]
ruby: ['2.7', '3.0', '3.1']
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
Expand All @@ -21,8 +21,6 @@ jobs:
run: bundle install
- name: Run rspec
run: ./scripts/run_chefspec
- name: Run rubocop
run: ./scripts/run_rubocop .rubocop.yml
- name: Run cookstyle
run: ./scripts/run_cookstyle
kitchen:
Expand All @@ -39,24 +37,24 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install Chef
uses: actionshub/chef-install@1.1.0
uses: actionshub/chef-install@2.0.4
with:
project: chef-workstation
version: 20.11.180
- name: Run Kitchen
uses: actionshub/test-kitchen@2.0.0
uses: actionshub/test-kitchen@2.1.0
with:
suite: default
os: ${{ matrix.os }}
env:
CHEF_LICENSE: accept-no-persist
CHEF_VERSION: 14.15.6
CHEF_VERSION: 16.18.0
shellcheck:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Run Shellcheck
uses: ludeeus/action-shellcheck@0.3.0
uses: ludeeus/action-shellcheck@2.0.0
8 changes: 2 additions & 6 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
AllCops:
DisabledByDefault: true
TargetRubyVersion: 2.4
TargetRubyVersion: 2.5
Exclude:
# template files named `rb` instead of `erb` are a sin against ruby-nature.
- '**/templates/**/*.rb'#
Expand Down Expand Up @@ -325,19 +325,15 @@ Lint/AmbiguousOperator:

Lint/AmbiguousRegexpLiteral:
Enabled: true
# TODO re-enable autocorrection on RuboCop >= v1.19 see https://github.com/rubocop/rubocop/issues/10002
AutoCorrect: false

Lint/AssignmentInCondition:
Enabled: true

Lint/BigDecimalNew:
Enabled: true

# TODO move exception to file after chef-workstation upgrade
Lint/BinaryOperatorWithIdenticalOperands:
Exclude:
- cookbooks/fb_helpers/spec/version_spec.rb
Enabled: true

Lint/BooleanSymbol:
Enabled: true
Expand Down
Loading

0 comments on commit 4127c83

Please sign in to comment.