Skip to content

Commit 7f07751

Browse files
arutkowski00NuckChorris
authored andcommitted
feat: add @Policy and respect federation_version in link
refactor: fix rubocop offenses ci: add Github Actions (Gusto#4) ci: add missing env variable (Gusto#5) ci: add GEM_HOST_API_KEY (Gusto#6) chore: upgrade packages (Gusto#8) ci: add BUNDLE_FROZEN: false to allow semantic release (Gusto#9) ci: use different github token for release (Gusto#10) feat: add support for @composeDirective (Gusto#3) Co-authored-by: Yannick Utard <[email protected]> chore(release): 3.10.0 [skip ci] * add support for [@compose](https://github.com/compose)Directive ([Gusto#3](mondaycom#3)) ([6d7ccf2](mondaycom@6d7ccf2)) feat: drop old ruby; remove appraisals (Gusto#290) * feat: drop old ruby; remove appraisals * ruby 3.4 fix * Fix feat: update google-protobuf (Gusto#291) * Try new protobuf * Cop * Bump version chore(release): 3.10.0 [skip ci] * update google-protobuf ([Gusto#291](Gusto#291)) ([2deda45](Gusto@2deda45))
1 parent 5bc0775 commit 7f07751

25 files changed

+719
-186
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Appraisal install
2+
inputs:
3+
appraisal:
4+
description: "Appraisal version to install"
5+
required: true
6+
7+
runs:
8+
using: "composite"
9+
steps:
10+
- name: Copy lockfile
11+
shell: bash
12+
run: bundle exec appraisal ${{ inputs.appraisal }} "cp \$BUNDLE_GEMFILE.lock current_appraisal.gemfile.lock"
13+
- name: Appraisal package cache
14+
uses: actions/cache@v4
15+
with:
16+
key: v6-gem-cache-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('current_appraisal.gemfile.lock') }}
17+
path: vendor/bundle
18+
restore-keys: |
19+
v6-gem-cache-${{ runner.os }}-${{ github.ref }}-
20+
v6-gem-cache-${{ runner.os }}-
21+
- name: Install appraisal dependencies
22+
shell: bash
23+
run: bundle exec appraisal ${{ inputs.appraisal }} bundle install --jobs=1 --retry=3 --path=../vendor/bundle

.github/workflows/ci.yml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: Main
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
8+
jobs:
9+
ruby-lint:
10+
runs-on: ubuntu-latest
11+
env:
12+
BUNDLE_APP_CONFIG: .bundle
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: ruby/setup-ruby@v1
16+
with:
17+
ruby-version: '3.2'
18+
bundler-cache: true
19+
- run: bundle exec rubocop
20+
ruby-test:
21+
runs-on: ubuntu-latest
22+
env:
23+
BUNDLE_APP_CONFIG: .bundle
24+
strategy:
25+
fail-fast: false
26+
matrix:
27+
appraisal: [ 'graphql-1.10', 'graphql-1.11', 'graphql-1.12', 'graphql-1.13', 'graphql-2.0' ]
28+
ruby: [ '3.0', '3.1', '3.2' ]
29+
exclude:
30+
- appraisal: 'graphql-1.10'
31+
ruby: '3.2'
32+
- appraisal: 'graphql-1.11'
33+
ruby: '3.2'
34+
- appraisal: 'graphql-1.12'
35+
ruby: '3.2'
36+
steps:
37+
- uses: actions/checkout@v4
38+
- uses: ruby/setup-ruby@v1
39+
with:
40+
ruby-version: ${{ matrix.ruby }}
41+
bundler-cache: true
42+
- name: Run appraisal install
43+
uses: ./.github/actions/appraisal-install
44+
with:
45+
appraisal: ${{ matrix.appraisal }}
46+
- run: bundle config list
47+
- run: bundle exec appraisal ${{ matrix.appraisal }} bundle config list
48+
- run: bundle exec appraisal ${{ matrix.appraisal }} rake
49+
50+
integration-tests:
51+
runs-on: ubuntu-latest
52+
env:
53+
BUNDLE_APP_CONFIG: .bundle
54+
strategy:
55+
fail-fast: false
56+
matrix:
57+
appraisal: [ 'graphql-1.10', 'graphql-1.11', 'graphql-1.12', 'graphql-1.13', 'graphql-2.0' ]
58+
ruby: [ '3.0', '3.1', '3.2' ]
59+
exclude:
60+
- appraisal: 'graphql-1.10'
61+
ruby: '3.2'
62+
- appraisal: 'graphql-1.11'
63+
ruby: '3.2'
64+
- appraisal: 'graphql-1.12'
65+
ruby: '3.2'
66+
steps:
67+
- uses: actions/checkout@v4
68+
- uses: ruby/setup-ruby@v1
69+
with:
70+
ruby-version: ${{ matrix.ruby }}
71+
bundler-cache: true
72+
- name: Run appraisal install
73+
uses: ./.github/actions/appraisal-install
74+
with:
75+
appraisal: ${{ matrix.appraisal }}
76+
- name: Run install
77+
uses: borales/actions-yarn@v4
78+
with:
79+
cmd: install
80+
- run: bundle exec appraisal ${{ matrix.appraisal }} yarn test
81+
- run: yarn lint
82+
83+
release:
84+
runs-on: ubuntu-latest
85+
needs: [ ruby-lint, ruby-test, integration-tests ]
86+
if: github.ref == 'refs/heads/main'
87+
env:
88+
BUNDLE_APP_CONFIG: .bundle
89+
GEM_HOST_API_KEY: ${{ secrets.GEM_HOST_API_KEY }}
90+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
91+
steps:
92+
- uses: actions/checkout@v4
93+
- uses: ruby/setup-ruby@v1
94+
with:
95+
ruby-version: '3.2'
96+
bundler-cache: true
97+
- name: Run install
98+
uses: borales/actions-yarn@v4
99+
with:
100+
cmd: install
101+
- run: npx semantic-release
102+
env:
103+
BUNDLE_FROZEN: false
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: "Semantic PR Title"
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
types:
8+
- opened
9+
- edited
10+
- synchronize
11+
- reopened
12+
13+
permissions:
14+
pull-requests: write
15+
16+
jobs:
17+
main:
18+
name: Validate PR title
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: amannn/action-semantic-pull-request@v5
22+
id: lint_pr_title
23+
env:
24+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
26+
- uses: marocchino/sticky-pull-request-comment@v2
27+
# When the previous steps fails, the workflow would stop. By adding this
28+
# condition you can continue the execution with the populated error message.
29+
if: always() && (steps.lint_pr_title.outputs.error_message != null)
30+
with:
31+
header: pr-title-lint-error
32+
message: |
33+
Hey there and thank you for opening this pull request! 👋🏼
34+
35+
We require pull request titles to follow the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/) and it looks like your proposed title needs to be adjusted.
36+
37+
Details:
38+
39+
```
40+
${{ steps.lint_pr_title.outputs.error_message }}
41+
```
42+
43+
# Delete a previous comment when the issue has been resolved
44+
- if: ${{ steps.lint_pr_title.outputs.error_message == null }}
45+
uses: marocchino/sticky-pull-request-comment@v2
46+
with:
47+
header: pr-title-lint-error
48+
delete: true

.github/workflows/semantic.yml

Lines changed: 0 additions & 17 deletions
This file was deleted.

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@ node_modules/
99
.circleci/processed-config.yml
1010

1111
.DS_Store
12+
13+
/.idea

.rubocop.yml

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,15 @@ require: rubocop-rspec
33
AllCops:
44
TargetRubyVersion: 2.3
55
DisplayCopNames: true
6+
NewCops: disable
67
Exclude:
78
- 'node_modules/**/*'
89
- 'gemfiles/**/*'
910
- 'vendor/**/*'
1011
- lib/apollo-federation/tracing/proto/apollo_pb.rb
1112

13+
Gemspec/DevelopmentDependencies:
14+
Enabled: false
1215
#
1316
# We prefer trailing commas so that the git diff is reduced when adding elements
1417
#
@@ -21,8 +24,6 @@ Style/TrailingCommaInArrayLiteral:
2124
Style/TrailingCommaInHashLiteral:
2225
Enabled: true
2326
EnforcedStyleForMultiline: consistent_comma
24-
Style/BracesAroundHashParameters:
25-
EnforcedStyle: context_dependent
2627
Style/ConditionalAssignment:
2728
EnforcedStyle: assign_inside_condition
2829
IncludeTernaryExpressions: false
@@ -38,7 +39,12 @@ Style/NegatedIf:
3839
Enabled: false
3940
Style/Documentation:
4041
Enabled: false
41-
42+
Style/HashAsLastArrayItem:
43+
Enabled: false
44+
Naming/VariableNumber:
45+
Enabled: false
46+
Lint/ConstantDefinitionInBlock:
47+
Enabled: false
4248
Metrics/AbcSize:
4349
Enabled: false
4450
Metrics/BlockLength:
@@ -50,11 +56,10 @@ Metrics/ModuleLength:
5056
Metrics/ParameterLists:
5157
Max: 5
5258
CountKeywordArgs: false
53-
Metrics/LineLength:
59+
Layout/LineLength:
5460
Max: 120
5561
Exclude:
5662
- lib/apollo-federation/tracing/proto/apollo_pb.rb
57-
5863
Naming/FileName:
5964
Exclude:
6065
- 'lib/apollo-federation.rb'
@@ -64,10 +69,21 @@ RSpec/ExampleLength:
6469
Enabled: false
6570
RSpec/NestedGroups:
6671
Enabled: false
67-
RSpec/FilePath:
72+
RSpec/SpecFilePathFormat:
6873
CustomTransform:
6974
ApolloFederation: apollo-federation
70-
75+
RSpec/RepeatedExampleGroupDescription:
76+
Enabled: false
77+
RSpec/LeakyConstantDeclaration:
78+
Enabled: false
79+
RSpec/MultipleMemoizedHelpers:
80+
Enabled: false
81+
RSpec/IndexedLet:
82+
Enabled: false
83+
RSpec/EmptyLineAfterExample:
84+
Enabled: false
85+
RSpec/MatchArray:
86+
Enabled: false
7187
# Disabled so we can support Ruby 2.2
7288
# Rubocop only supports >= 2.3
7389
Gemspec/RequiredRubyVersion:

.stignore

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
*.gem
2+
*.rbc
3+
.idea
4+
coverage
5+
InstalledFiles
6+
pkg
7+
spec/reports
8+
spec/examples.txt
9+
test/tmp
10+
test/version_tmp
11+
tmp
12+
13+
# Ignore Byebug command history file.
14+
.byebug_history
15+
16+
## Specific to RubyMotion:
17+
.dat*
18+
.repl_history
19+
build
20+
*.bridgesupport
21+
build-iPhoneOS
22+
build-iPhoneSimulator
23+
24+
## Specific to RubyMotion (use of CocoaPods):
25+
#
26+
# We recommend against adding the Pods directory to your .gitignore. However
27+
# you should judge for yourself, the pros and cons are mentioned at:
28+
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
29+
#
30+
# vendor/Pods/
31+
32+
## Documentation cache and generated files:
33+
.yardoc
34+
_yardoc
35+
36+
## Environment normalization:
37+
vendor/bundle
38+
lib/bundler/man
39+
40+
# for a library or gem, you might want to ignore these files since the code is
41+
# intended to run in multiple environments; otherwise, check them in:
42+
Gemfile.lock
43+
.ruby-version
44+
.ruby-gemset
45+
46+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
47+
.rvmrc

CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1+
# [3.10.0](https://github.com/mondaycom/apollo-federation-ruby/compare/v3.9.0...v3.10.0) (2024-11-21)
2+
3+
4+
### Features
5+
6+
* add support for [@compose](https://github.com/compose)Directive ([#3](https://github.com/mondaycom/apollo-federation-ruby/issues/3)) ([6d7ccf2](https://github.com/mondaycom/apollo-federation-ruby/commit/6d7ccf2e98ead837847ab1b16b44b3b68adbfe84))
7+
8+
# [3.9.0](https://github.com/mondaycom/apollo-federation-ruby/compare/v3.8.5...v3.9.0) (2024-11-20)
9+
10+
11+
### Features
12+
13+
* update google-protobuf ([#291](https://github.com/Gusto/apollo-federation-ruby/issues/291)) ([2deda45](https://github.com/Gusto/apollo-federation-ruby/commit/2deda45fd37b6e7e9749a0be43b83def6963b8b6))
14+
15+
# [3.9.0](https://github.com/Gusto/apollo-federation-ruby/compare/v3.8.5...v3.9.0) (2025-02-05)
16+
17+
18+
### Features
19+
20+
* drop old ruby; remove appraisals ([#290](https://github.com/Gusto/apollo-federation-ruby/issues/290)) ([9caa715](https://github.com/Gusto/apollo-federation-ruby/commit/9caa7159b16cf813b23bc067ef2d2b33b06501a2))
21+
122
# [3.10.0](https://github.com/Gusto/apollo-federation-ruby/compare/v3.9.0...v3.10.0) (2025-02-05)
223

324

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ source 'https://rubygems.org'
44

55
gemspec
66

7+
gem 'appraisal', '~> 2.5.0'
78
gem 'graphql', '~> 2.0.0'

0 commit comments

Comments
 (0)