Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for @composeDirective #3

Merged
merged 25 commits into from
Nov 21, 2024
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
c8f5259
Add support for @composeDirective
utay Jun 14, 2023
2f19d5e
Use schema.join
utay Jun 15, 2023
66d060d
Lint, add links test
utay Jun 16, 2023
15cfca6
Merge pull request #1 from sorare/yu/compose-directive
utay Jun 16, 2023
ede329b
Add required to argument
utay Jun 16, 2023
96ec2ca
Drop minor version check
utay Aug 1, 2023
d373b7a
Make federation_2_prefix easier to read
utay Aug 1, 2023
0701bff
Lint
utay Aug 1, 2023
3cf158f
Add @policy and use federation_version in link
arutkowski00 Oct 31, 2024
8e41028
Improve ignores
arutkowski00 Oct 31, 2024
5ab53ba
Add policy directive
arutkowski00 Nov 13, 2024
cd90a71
Merge pull request #2 from mondaycom/feature/add-policy
arutkowski00 Nov 14, 2024
8911a18
Merge branch 'main' of github.com:sorare/apollo-federation-ruby into …
arutkowski00 Nov 14, 2024
27de46e
chore: create Github CI config
arutkowski00 Nov 14, 2024
e14052a
Upgrade rubocop, tweak rules & remove problematic package
arutkowski00 Nov 14, 2024
60dabf8
Fix tests
arutkowski00 Nov 19, 2024
af6265a
Don't run semantic release in PRs
arutkowski00 Nov 19, 2024
c278c90
Merge branch 'feature/github-ci' into feature/compose-directive
arutkowski00 Nov 20, 2024
e633d4e
Merge remote-tracking branch 'origin/main' into feature/compose-direc…
arutkowski00 Nov 20, 2024
1268834
Merge branch 'main' into feature/compose-directive
arutkowski00 Nov 20, 2024
0057d54
ci: split workflows
arutkowski00 Nov 20, 2024
b8d7d2f
delete semantic release notes (won't work)
arutkowski00 Nov 20, 2024
e4f5978
Check all links for imported directive
arutkowski00 Nov 20, 2024
4a497b8
Make functions public
arutkowski00 Nov 20, 2024
a59c8e0
Invert logic to satisfy RuboCop
arutkowski00 Nov 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Upgrade rubocop, tweak rules & remove problematic package
  • Loading branch information
arutkowski00 committed Nov 19, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit e14052a15c4cd6ba8373174e55d957142d4b26e2
2 changes: 1 addition & 1 deletion .github/actions/appraisal-install/action.yml
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ runs:
steps:
- name: Copy lockfile
shell: bash
run: bundle exec ${{ inputs.appraisal }} "cp $BUNDLE_GEMFILE.lock current_appraisal.gemfile.lock"
run: bundle exec appraisal ${{ inputs.appraisal }} "cp \$BUNDLE_GEMFILE.lock current_appraisal.gemfile.lock"
- name: Appraisal package cache
uses: actions/cache@v4
with:
8 changes: 5 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -39,7 +39,8 @@ jobs:
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- uses: ./.github/actions/appraisal-install
- name: Run appraisal install
uses: ./.github/actions/appraisal-install
with:
appraisal: ${{ matrix.appraisal }}
- run: bundle config list
@@ -54,7 +55,7 @@ jobs:
fail-fast: false
matrix:
appraisal: [ 'graphql-1.10', 'graphql-1.11', 'graphql-1.12', 'graphql-1.13', 'graphql-2.0' ]
ruby: [ '2.7', '3.0', '3.1', '3.2' ]
ruby: [ '3.0', '3.1', '3.2' ]
exclude:
- appraisal: 'graphql-1.10'
ruby: '3.2'
@@ -68,7 +69,8 @@ jobs:
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- uses: ./.github/actions/appraisal-install
- name: Run appraisal install
uses: ./.github/actions/appraisal-install
with:
appraisal: ${{ matrix.appraisal }}
- name: Run install
2 changes: 1 addition & 1 deletion .github/workflows/semantic.yml
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ on:
- reopened

permissions:
pull-requests: read
pull-requests: write

jobs:
main:
30 changes: 23 additions & 7 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -3,11 +3,14 @@ require: rubocop-rspec
AllCops:
TargetRubyVersion: 2.3
DisplayCopNames: true
NewCops: disable
Exclude:
- 'node_modules/**/*'
- 'gemfiles/**/*'
- 'vendor/**/*'

Gemspec/DevelopmentDependencies:
Enabled: false
#
# We prefer trailing commas so that the git diff is reduced when adding elements
#
@@ -20,8 +23,6 @@ Style/TrailingCommaInArrayLiteral:
Style/TrailingCommaInHashLiteral:
Enabled: true
EnforcedStyleForMultiline: consistent_comma
Style/BracesAroundHashParameters:
EnforcedStyle: context_dependent
Style/ConditionalAssignment:
EnforcedStyle: assign_inside_condition
IncludeTernaryExpressions: false
@@ -37,7 +38,12 @@ Style/NegatedIf:
Enabled: false
Style/Documentation:
Enabled: false

Style/HashAsLastArrayItem:
Enabled: false
Naming/VariableNumber:
Enabled: false
Lint/ConstantDefinitionInBlock:
Enabled: false
Metrics/AbcSize:
Enabled: false
Metrics/BlockLength:
@@ -49,11 +55,10 @@ Metrics/ModuleLength:
Metrics/ParameterLists:
Max: 5
CountKeywordArgs: false
Metrics/LineLength:
Layout/LineLength:
Max: 120
Exclude:
- lib/apollo-federation/tracing/proto/apollo_pb.rb

Naming/FileName:
Exclude:
- 'lib/apollo-federation.rb'
@@ -63,10 +68,21 @@ RSpec/ExampleLength:
Enabled: false
RSpec/NestedGroups:
Enabled: false
RSpec/FilePath:
RSpec/SpecFilePathFormat:
CustomTransform:
ApolloFederation: apollo-federation

RSpec/RepeatedExampleGroupDescription:
Enabled: false
RSpec/LeakyConstantDeclaration:
Enabled: false
RSpec/MultipleMemoizedHelpers:
Enabled: false
RSpec/IndexedLet:
Enabled: false
RSpec/EmptyLineAfterExample:
Enabled: false
RSpec/MatchArray:
Enabled: false
# Disabled so we can support Ruby 2.2
# Rubocop only supports >= 2.3
Gemspec/RequiredRubyVersion:
39 changes: 20 additions & 19 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -42,16 +42,14 @@ GEM
coderay (1.1.3)
concurrent-ruby (1.2.2)
crass (1.0.6)
debase (0.2.5.beta2)
debase-ruby_core_source (>= 0.10.12)
debase-ruby_core_source (3.2.0)
diff-lcs (1.5.0)
erubi (1.12.0)
google-protobuf (3.22.2)
graphql (2.0.19)
i18n (1.12.0)
concurrent-ruby (~> 1.0)
jaro_winkler (1.5.4)
json (2.8.1)
language_server-protocol (3.17.0.3)
loofah (2.19.1)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
@@ -67,16 +65,17 @@ GEM
racc (~> 1.4)
nokogiri (1.14.2-x86_64-linux)
racc (~> 1.4)
parallel (1.22.1)
parser (3.2.1.1)
parallel (1.26.3)
parser (3.3.6.0)
ast (~> 2.4.1)
racc
pry (0.14.2)
coderay (~> 1.1)
method_source (~> 1.0)
pry-byebug (3.10.1)
byebug (~> 11.0)
pry (>= 0.13, < 0.15)
racc (1.6.2)
racc (1.8.1)
rack (2.2.6.4)
rack-test (2.1.0)
rack (>= 1.3)
@@ -87,6 +86,7 @@ GEM
loofah (~> 2.19, >= 2.19.1)
rainbow (3.1.1)
rake (13.0.6)
regexp_parser (2.9.2)
rspec (3.12.0)
rspec-core (~> 3.12.0)
rspec-expectations (~> 3.12.0)
@@ -100,22 +100,25 @@ GEM
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-support (3.12.0)
rubocop (0.75.1)
jaro_winkler (~> 1.5.1)
rubocop (1.68.0)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 2.6)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.4, < 3.0)
rubocop-ast (>= 1.32.2, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 1.7)
rubocop-rspec (1.33.0)
rubocop (>= 0.60.0)
ruby-debug-ide (0.7.3)
rake (>= 0.8.1)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.36.1)
parser (>= 3.3.1.0)
rubocop-rspec (3.2.0)
rubocop (~> 1.61)
ruby-progressbar (1.13.0)
thor (1.2.1)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (1.6.1)
unicode-display_width (2.6.0)
webrick (1.8.1)

PLATFORMS
@@ -131,15 +134,13 @@ DEPENDENCIES
actionpack
apollo-federation!
appraisal!
debase (= 0.2.5.beta2)
graphql (~> 2.0.0)
pry-byebug
rack
rake
rspec
rubocop (~> 0.75.0)
rubocop (~> 1.68.0)
rubocop-rspec
ruby-debug-ide
webrick

BUNDLED WITH
7 changes: 3 additions & 4 deletions apollo-federation.gemspec
Original file line number Diff line number Diff line change
@@ -22,23 +22,22 @@ Gem::Specification.new do |spec|
'changelog_uri' => 'https://github.com/Gusto/apollo-federation-ruby/releases',
'source_code_uri' => 'https://github.com/Gusto/apollo-federation-ruby',
'bug_tracker_uri' => 'https://github.com/Gusto/apollo-federation-ruby/issues',
'rubygems_mfa_required' => 'true',
}

spec.files = `git ls-files bin lib *.md LICENSE`.split("\n")

spec.add_dependency 'graphql', '>= 1.10.14'

spec.add_runtime_dependency 'google-protobuf', '~> 3.22'
spec.add_dependency 'google-protobuf', '~> 3.22'

spec.add_development_dependency 'actionpack'
spec.add_development_dependency 'appraisal'
spec.add_development_dependency 'debase', '0.2.5.beta2'
spec.add_development_dependency 'pry-byebug'
spec.add_development_dependency 'rack'
spec.add_development_dependency 'rake'
spec.add_development_dependency 'rspec'
spec.add_development_dependency 'rubocop', '~> 0.75.0'
spec.add_development_dependency 'rubocop', '~> 1.68.0'
spec.add_development_dependency 'rubocop-rspec'
spec.add_development_dependency 'ruby-debug-ide'
spec.add_development_dependency 'webrick'
end
2 changes: 2 additions & 0 deletions lib/apollo-federation/entities_field.rb
Original file line number Diff line number Diff line change
@@ -26,6 +26,7 @@ def define_entities_field(possible_entities)
end
end

# rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
def _entities(representations:)
final_result = Array.new(representations.size)
grouped_references_with_indices =
@@ -85,6 +86,7 @@ def _entities(representations:)
final_result
end
end
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity

private

2 changes: 1 addition & 1 deletion lib/apollo-federation/schema.rb
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
require 'apollo-federation/entities_field'
require 'apollo-federation/service_field'
require 'apollo-federation/entity'
require 'apollo-federation/federated_document_from_schema_definition.rb'
require 'apollo-federation/federated_document_from_schema_definition'

module ApolloFederation
module Schema
1 change: 1 addition & 0 deletions lib/apollo-federation/tracing/node_map.rb
Original file line number Diff line number Diff line change
@@ -16,6 +16,7 @@ class NodeMap
ROOT_KEY = ''

attr_reader :nodes

def initialize
@nodes = {
ROOT_KEY => ApolloFederation::Tracing::Node.new,
Loading
Oops, something went wrong.