attio 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +39 -15
- data/.github/workflows/coverage.yml +67 -0
- data/.github/workflows/pr_checks.yml +25 -7
- data/.github/workflows/release.yml +27 -13
- data/.github/workflows/tests.yml +67 -0
- data/.rubocop.yml +362 -90
- data/CHANGELOG.md +49 -1
- data/CONCEPTS.md +428 -0
- data/CONTRIBUTING.md +4 -4
- data/Gemfile +8 -5
- data/Gemfile.lock +4 -4
- data/README.md +164 -2
- data/Rakefile +8 -6
- data/attio.gemspec +6 -7
- data/danger/Dangerfile +22 -34
- data/docs/example.rb +30 -29
- data/examples/advanced_filtering.rb +178 -0
- data/examples/basic_usage.rb +110 -0
- data/examples/collaboration_example.rb +173 -0
- data/examples/full_workflow.rb +348 -0
- data/examples/notes_and_tasks.rb +200 -0
- data/lib/attio/client.rb +67 -29
- data/lib/attio/connection_pool.rb +26 -14
- data/lib/attio/errors.rb +4 -2
- data/lib/attio/http_client.rb +70 -41
- data/lib/attio/logger.rb +37 -27
- data/lib/attio/resources/attributes.rb +12 -5
- data/lib/attio/resources/base.rb +66 -27
- data/lib/attio/resources/comments.rb +147 -0
- data/lib/attio/resources/lists.rb +21 -24
- data/lib/attio/resources/notes.rb +110 -0
- data/lib/attio/resources/objects.rb +11 -4
- data/lib/attio/resources/records.rb +49 -67
- data/lib/attio/resources/tasks.rb +131 -0
- data/lib/attio/resources/threads.rb +154 -0
- data/lib/attio/resources/users.rb +10 -4
- data/lib/attio/resources/workspaces.rb +9 -1
- data/lib/attio/retry_handler.rb +19 -11
- data/lib/attio/version.rb +3 -1
- data/lib/attio.rb +15 -9
- metadata +13 -18
- data/run_tests.rb +0 -52
- data/test_basic.rb +0 -51
- data/test_typhoeus.rb +0 -31
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c28065cbac5cffee49ef7864e60d19543ab116ef2bea68374ec2b995476efbd9
|
4
|
+
data.tar.gz: 31036f5bd6d0fd23b827176fe6a52f620d17042fe1bc6d55f2c5f86bb03a09c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0a5e5fb4654d9bbb579babffde8540d6bbd3dc0b1463a22eb8838c42095e8e368fbe3f712a6e85a49bfdaf8d3adeb2386769591c36ebf0bb035b22bdeb407c6
|
7
|
+
data.tar.gz: fe5085f5f9b20e688ff8f4c7e21f42482432c911fe135f9df5f4acab92e101585c5b5d719f78d8fd349e020e038a0f8fd3d144e80816eeabe1b78b25570e7e1d
|
data/.github/workflows/ci.yml
CHANGED
@@ -2,9 +2,9 @@ name: CI
|
|
2
2
|
|
3
3
|
on:
|
4
4
|
push:
|
5
|
-
branches: [
|
5
|
+
branches: [ master ]
|
6
6
|
pull_request:
|
7
|
-
branches: [
|
7
|
+
branches: [ master ]
|
8
8
|
|
9
9
|
env:
|
10
10
|
RUBY_PLATFORM: ruby
|
@@ -15,7 +15,7 @@ jobs:
|
|
15
15
|
strategy:
|
16
16
|
fail-fast: false
|
17
17
|
matrix:
|
18
|
-
ruby-version: ['3.0', '3.1', '3.2', '3.3']
|
18
|
+
ruby-version: ['3.0', '3.1', '3.2', '3.3', '3.4']
|
19
19
|
|
20
20
|
steps:
|
21
21
|
- uses: actions/checkout@v4
|
@@ -24,20 +24,26 @@ jobs:
|
|
24
24
|
uses: ruby/setup-ruby@v1
|
25
25
|
with:
|
26
26
|
ruby-version: ${{ matrix.ruby-version }}
|
27
|
-
bundler-cache:
|
27
|
+
bundler-cache: false
|
28
|
+
|
29
|
+
- name: Install dependencies
|
30
|
+
run: |
|
31
|
+
gem install bundler -v 2.4.22
|
32
|
+
bundle config set --local deployment false
|
33
|
+
bundle install
|
28
34
|
|
29
35
|
- name: Create coverage directory
|
30
36
|
run: mkdir -p coverage
|
31
37
|
|
32
|
-
- name: Run tests
|
38
|
+
- name: Run RSpec tests
|
33
39
|
run: |
|
34
|
-
bundle exec
|
40
|
+
bundle exec rspec --format documentation
|
35
41
|
env:
|
36
42
|
COVERAGE: true
|
37
43
|
|
38
44
|
- name: Upload coverage to Codecov
|
39
45
|
uses: codecov/codecov-action@v4
|
40
|
-
if: matrix.ruby-version == '3.
|
46
|
+
if: matrix.ruby-version == '3.4'
|
41
47
|
with:
|
42
48
|
files: ./coverage/coverage.xml,./coverage/.resultset.json
|
43
49
|
flags: unittests
|
@@ -54,8 +60,14 @@ jobs:
|
|
54
60
|
- name: Set up Ruby
|
55
61
|
uses: ruby/setup-ruby@v1
|
56
62
|
with:
|
57
|
-
ruby-version: '3.
|
58
|
-
bundler-cache:
|
63
|
+
ruby-version: '3.4'
|
64
|
+
bundler-cache: false
|
65
|
+
|
66
|
+
- name: Install dependencies
|
67
|
+
run: |
|
68
|
+
gem install bundler -v 2.4.22
|
69
|
+
bundle config set --local deployment false
|
70
|
+
bundle install
|
59
71
|
|
60
72
|
- name: Run RuboCop
|
61
73
|
run: bundle exec rubocop --parallel --format github
|
@@ -69,13 +81,19 @@ jobs:
|
|
69
81
|
- name: Set up Ruby
|
70
82
|
uses: ruby/setup-ruby@v1
|
71
83
|
with:
|
72
|
-
ruby-version: '3.
|
73
|
-
bundler-cache:
|
84
|
+
ruby-version: '3.4'
|
85
|
+
bundler-cache: false
|
86
|
+
|
87
|
+
- name: Install dependencies
|
88
|
+
run: |
|
89
|
+
gem install bundler -v 2.4.22
|
90
|
+
bundle config set --local deployment false
|
91
|
+
bundle install
|
74
92
|
|
75
93
|
- name: Run bundler-audit
|
76
94
|
run: |
|
77
|
-
|
78
|
-
bundle
|
95
|
+
gem install bundler-audit
|
96
|
+
bundle-audit check --update || true
|
79
97
|
|
80
98
|
- name: Upload security scan results
|
81
99
|
uses: actions/upload-artifact@v4
|
@@ -93,8 +111,14 @@ jobs:
|
|
93
111
|
- name: Set up Ruby
|
94
112
|
uses: ruby/setup-ruby@v1
|
95
113
|
with:
|
96
|
-
ruby-version: '3.
|
97
|
-
bundler-cache:
|
114
|
+
ruby-version: '3.4'
|
115
|
+
bundler-cache: false
|
116
|
+
|
117
|
+
- name: Install dependencies
|
118
|
+
run: |
|
119
|
+
gem install bundler -v 2.4.22
|
120
|
+
bundle config set --local deployment false
|
121
|
+
bundle install
|
98
122
|
|
99
123
|
- name: Build gem
|
100
124
|
run: bundle exec gem build attio.gemspec
|
@@ -0,0 +1,67 @@
|
|
1
|
+
name: Coverage
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [ master ]
|
6
|
+
|
7
|
+
jobs:
|
8
|
+
coverage:
|
9
|
+
runs-on: ubuntu-latest
|
10
|
+
permissions:
|
11
|
+
contents: write
|
12
|
+
|
13
|
+
steps:
|
14
|
+
- uses: actions/checkout@v4
|
15
|
+
|
16
|
+
- name: Set up Ruby
|
17
|
+
uses: ruby/setup-ruby@v1
|
18
|
+
with:
|
19
|
+
ruby-version: '3.4'
|
20
|
+
bundler-cache: false
|
21
|
+
|
22
|
+
- name: Install dependencies
|
23
|
+
run: |
|
24
|
+
gem install bundler -v 2.4.22
|
25
|
+
bundle config set --local deployment false
|
26
|
+
bundle install
|
27
|
+
|
28
|
+
- name: Run tests with coverage
|
29
|
+
run: |
|
30
|
+
bundle exec rspec
|
31
|
+
env:
|
32
|
+
COVERAGE: true
|
33
|
+
|
34
|
+
- name: Generate coverage badge
|
35
|
+
run: |
|
36
|
+
if [ -f coverage/.last_run.json ]; then
|
37
|
+
COVERAGE=$(ruby -rjson -e "puts JSON.parse(File.read('coverage/.last_run.json'))['result']['line']")
|
38
|
+
echo "Coverage: ${COVERAGE}%"
|
39
|
+
|
40
|
+
# Determine color based on coverage
|
41
|
+
if (( $(echo "$COVERAGE >= 90" | bc -l) )); then
|
42
|
+
COLOR="brightgreen"
|
43
|
+
elif (( $(echo "$COVERAGE >= 80" | bc -l) )); then
|
44
|
+
COLOR="green"
|
45
|
+
elif (( $(echo "$COVERAGE >= 70" | bc -l) )); then
|
46
|
+
COLOR="yellow"
|
47
|
+
elif (( $(echo "$COVERAGE >= 60" | bc -l) )); then
|
48
|
+
COLOR="orange"
|
49
|
+
else
|
50
|
+
COLOR="red"
|
51
|
+
fi
|
52
|
+
|
53
|
+
# Create badge JSON
|
54
|
+
echo "{\"schemaVersion\": 1, \"label\": \"coverage\", \"message\": \"${COVERAGE}%\", \"color\": \"${COLOR}\"}" > coverage-badge.json
|
55
|
+
|
56
|
+
# Also create a simple text file for reference
|
57
|
+
echo "${COVERAGE}" > coverage-percentage.txt
|
58
|
+
fi
|
59
|
+
|
60
|
+
- name: Upload coverage artifacts
|
61
|
+
uses: actions/upload-artifact@v4
|
62
|
+
with:
|
63
|
+
name: coverage-report
|
64
|
+
path: |
|
65
|
+
coverage/
|
66
|
+
coverage-badge.json
|
67
|
+
coverage-percentage.txt
|
@@ -54,7 +54,7 @@ jobs:
|
|
54
54
|
fi
|
55
55
|
|
56
56
|
# Check if CHANGELOG.md was modified
|
57
|
-
if git diff --name-only origin/
|
57
|
+
if git diff --name-only origin/master...HEAD | grep -q "CHANGELOG.md"; then
|
58
58
|
echo "✅ CHANGELOG.md was updated"
|
59
59
|
else
|
60
60
|
echo "❌ Please update CHANGELOG.md with your changes"
|
@@ -70,8 +70,14 @@ jobs:
|
|
70
70
|
- name: Set up Ruby
|
71
71
|
uses: ruby/setup-ruby@v1
|
72
72
|
with:
|
73
|
-
ruby-version: '3.
|
74
|
-
bundler-cache:
|
73
|
+
ruby-version: '3.4'
|
74
|
+
bundler-cache: false
|
75
|
+
|
76
|
+
- name: Install dependencies
|
77
|
+
run: |
|
78
|
+
gem install bundler -v 2.4.22
|
79
|
+
bundle config set --local deployment false
|
80
|
+
bundle install
|
75
81
|
|
76
82
|
- name: Validate gemspec
|
77
83
|
run: |
|
@@ -95,8 +101,14 @@ jobs:
|
|
95
101
|
- name: Set up Ruby
|
96
102
|
uses: ruby/setup-ruby@v1
|
97
103
|
with:
|
98
|
-
ruby-version: '3.
|
99
|
-
bundler-cache:
|
104
|
+
ruby-version: '3.4'
|
105
|
+
bundler-cache: false
|
106
|
+
|
107
|
+
- name: Install dependencies
|
108
|
+
run: |
|
109
|
+
gem install bundler -v 2.4.22
|
110
|
+
bundle config set --local deployment false
|
111
|
+
bundle install
|
100
112
|
|
101
113
|
- name: Run Danger
|
102
114
|
run: bundle exec danger
|
@@ -111,8 +123,14 @@ jobs:
|
|
111
123
|
- name: Set up Ruby
|
112
124
|
uses: ruby/setup-ruby@v1
|
113
125
|
with:
|
114
|
-
ruby-version: '3.
|
115
|
-
bundler-cache:
|
126
|
+
ruby-version: '3.4'
|
127
|
+
bundler-cache: false
|
128
|
+
|
129
|
+
- name: Install dependencies
|
130
|
+
run: |
|
131
|
+
gem install bundler -v 2.4.22
|
132
|
+
bundle config set --local deployment false
|
133
|
+
bundle install
|
116
134
|
|
117
135
|
- name: Run security checks
|
118
136
|
run: |
|
@@ -14,7 +14,7 @@ jobs:
|
|
14
14
|
strategy:
|
15
15
|
fail-fast: false
|
16
16
|
matrix:
|
17
|
-
ruby-version: ['3.0', '3.1', '3.2', '3.3']
|
17
|
+
ruby-version: ['3.0', '3.1', '3.2', '3.3', '3.4']
|
18
18
|
|
19
19
|
steps:
|
20
20
|
- uses: actions/checkout@v4
|
@@ -23,13 +23,19 @@ jobs:
|
|
23
23
|
uses: ruby/setup-ruby@v1
|
24
24
|
with:
|
25
25
|
ruby-version: ${{ matrix.ruby-version }}
|
26
|
-
bundler-cache:
|
26
|
+
bundler-cache: false
|
27
|
+
|
28
|
+
- name: Install dependencies
|
29
|
+
run: |
|
30
|
+
gem install bundler -v 2.4.22
|
31
|
+
bundle config set --local deployment false
|
32
|
+
bundle install
|
27
33
|
|
28
34
|
- name: Run tests
|
29
35
|
run: bundle exec rspec
|
30
36
|
|
31
37
|
- name: Run RuboCop
|
32
|
-
if: matrix.ruby-version == '3.
|
38
|
+
if: matrix.ruby-version == '3.4'
|
33
39
|
run: bundle exec rubocop
|
34
40
|
|
35
41
|
build-and-publish:
|
@@ -47,8 +53,14 @@ jobs:
|
|
47
53
|
- name: Set up Ruby
|
48
54
|
uses: ruby/setup-ruby@v1
|
49
55
|
with:
|
50
|
-
ruby-version: '3.
|
51
|
-
bundler-cache:
|
56
|
+
ruby-version: '3.4'
|
57
|
+
bundler-cache: false
|
58
|
+
|
59
|
+
- name: Install dependencies
|
60
|
+
run: |
|
61
|
+
gem install bundler -v 2.4.22
|
62
|
+
bundle config set --local deployment false
|
63
|
+
bundle install
|
52
64
|
|
53
65
|
- name: Extract version from tag
|
54
66
|
id: version
|
@@ -60,13 +72,9 @@ jobs:
|
|
60
72
|
echo "GEM_FILE=$(ls attio-*.gem)" >> $GITHUB_ENV
|
61
73
|
|
62
74
|
- name: Publish to RubyGems
|
75
|
+
env:
|
76
|
+
GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_AUTH_TOKEN }}
|
63
77
|
run: |
|
64
|
-
mkdir -p ~/.gem
|
65
|
-
cat << 'EOF' > ~/.gem/credentials
|
66
|
-
---
|
67
|
-
:rubygems_api_key: ${{ secrets.RUBYGEMS_API_KEY }}
|
68
|
-
EOF
|
69
|
-
chmod 0600 ~/.gem/credentials
|
70
78
|
gem push ${{ env.GEM_FILE }}
|
71
79
|
|
72
80
|
- name: Generate changelog
|
@@ -123,8 +131,14 @@ jobs:
|
|
123
131
|
- name: Set up Ruby
|
124
132
|
uses: ruby/setup-ruby@v1
|
125
133
|
with:
|
126
|
-
ruby-version: '3.
|
127
|
-
bundler-cache:
|
134
|
+
ruby-version: '3.4'
|
135
|
+
bundler-cache: false
|
136
|
+
|
137
|
+
- name: Install dependencies
|
138
|
+
run: |
|
139
|
+
gem install bundler -v 2.4.22
|
140
|
+
bundle config set --local deployment false
|
141
|
+
bundle install
|
128
142
|
|
129
143
|
- name: Extract version from tag
|
130
144
|
id: version
|
@@ -0,0 +1,67 @@
|
|
1
|
+
name: Tests
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [ master ]
|
6
|
+
pull_request:
|
7
|
+
branches: [ master ]
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
rspec:
|
11
|
+
runs-on: ubuntu-latest
|
12
|
+
name: RSpec Tests
|
13
|
+
|
14
|
+
steps:
|
15
|
+
- uses: actions/checkout@v4
|
16
|
+
|
17
|
+
- name: Set up Ruby
|
18
|
+
uses: ruby/setup-ruby@v1
|
19
|
+
with:
|
20
|
+
ruby-version: '3.4'
|
21
|
+
bundler-cache: false
|
22
|
+
|
23
|
+
- name: Install dependencies
|
24
|
+
run: |
|
25
|
+
gem install bundler -v 2.4.22
|
26
|
+
bundle config set --local deployment false
|
27
|
+
bundle install
|
28
|
+
|
29
|
+
- name: Run RSpec with Coverage
|
30
|
+
run: |
|
31
|
+
bundle exec rspec --format documentation --format json --out rspec-results.json
|
32
|
+
env:
|
33
|
+
COVERAGE: true
|
34
|
+
|
35
|
+
- name: Parse Test Results
|
36
|
+
if: always()
|
37
|
+
run: |
|
38
|
+
if [ -f rspec-results.json ]; then
|
39
|
+
echo "## Test Results" >> $GITHUB_STEP_SUMMARY
|
40
|
+
echo "" >> $GITHUB_STEP_SUMMARY
|
41
|
+
TOTAL=$(jq '.summary.example_count' rspec-results.json)
|
42
|
+
PASSED=$(jq '.summary.example_count - .summary.failure_count' rspec-results.json)
|
43
|
+
FAILED=$(jq '.summary.failure_count' rspec-results.json)
|
44
|
+
DURATION=$(jq '.summary.duration' rspec-results.json)
|
45
|
+
|
46
|
+
echo "✅ **Passed:** $PASSED/$TOTAL tests" >> $GITHUB_STEP_SUMMARY
|
47
|
+
if [ "$FAILED" -gt 0 ]; then
|
48
|
+
echo "❌ **Failed:** $FAILED tests" >> $GITHUB_STEP_SUMMARY
|
49
|
+
fi
|
50
|
+
echo "⏱️ **Duration:** ${DURATION}s" >> $GITHUB_STEP_SUMMARY
|
51
|
+
|
52
|
+
if [ -f coverage/.last_run.json ]; then
|
53
|
+
echo "" >> $GITHUB_STEP_SUMMARY
|
54
|
+
echo "## Coverage Report" >> $GITHUB_STEP_SUMMARY
|
55
|
+
COVERAGE=$(jq '.result.line' coverage/.last_run.json)
|
56
|
+
echo "📊 **Line Coverage:** ${COVERAGE}%" >> $GITHUB_STEP_SUMMARY
|
57
|
+
fi
|
58
|
+
fi
|
59
|
+
|
60
|
+
- name: Upload Test Results
|
61
|
+
if: always()
|
62
|
+
uses: actions/upload-artifact@v4
|
63
|
+
with:
|
64
|
+
name: rspec-results
|
65
|
+
path: |
|
66
|
+
rspec-results.json
|
67
|
+
coverage/
|