Skip to content

Conversation

@fern-support
Copy link
Collaborator

This PR is for the v44 release of the Ruby SDK, generated using Fern.

fern-support and others added 17 commits August 18, 2025 11:29
* ignore claude

* intiial test helpers file

* strongly type obj creation in helpers.rb

* add more test files

* bulk convert tests with cursor

* use typeful .new() factory methods

* regenerate with ruby v2

* restore gemfile and rakefile to main

* fix relative imports

* square.rb file

* find/replace 'module square' --> 'module Square'

* replace square::Internal --> Square::Internal

* replace ' Internal::' --> ' Square::Internal::'

* simplify square.rb

* add end statements to else blocks

* fix incorrect end statements in request types

* change square::internal::json::serializable from class to module

* update requirements in helpers.rb

* fix test helpers imports

* fix missing end after else in clients

* ensure request and response types extend model

* more requests extend model

* remove bad extensions

* fix bad class end formatting

* fix more bad class end formatting

* fix enum files

* migrate extends syntax

* update type references to error enums

* temp commit lib/squre.rb

* change tab size to 2

* fix internal lowercase square

* fix empty class end syntax

* regen

* fix else ends

* update type mapping

* revert type mapping change

* manually update gemfile, rakefile, and rubocop file from demo sdk

* remove generated code

* regen sdk

* remove square.rb file

* update module file

* remove ghost types

* fix enum include to extend

* disable tests

---------

Co-authored-by: jsklan <jsklan.development@gmail.com>
* pull in test helper infra from demo

* pull in base catalog tests

---------

Co-authored-by: jsklan <jsklan.development@gmail.com>
Co-authored-by: jsklan <jsklan.development@gmail.com>
* update fernignore (#163)

* update fernignore

* remove ignores

---------

Co-authored-by: jsklan <jsklan.development@gmail.com>

* SDK regeneration

---------

Co-authored-by: Fern Support <126544928+fern-support@users.noreply.github.com>
Co-authored-by: jsklan <jsklan.development@gmail.com>
Co-authored-by: fern-api <115122769+fern-api[bot]@users.noreply.github.com>
* tmp

* add ci test

* update rakefile

* update token name options

---------

Co-authored-by: jsklan <jsklan.development@gmail.com>
Comment on lines +21 to +50
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: ['3.2', '3.3', '3.4']
bundler-version: ${{ env.BUNDLER_VERSION }}

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-version: ${{ matrix.bundler-version }}
bundler-cache: true

- name: Install dependencies
run: |
bundle install

- name: Build gem
run: |
bundle exec rake build

- name: Run tests
run: |
bundle exec rake test

lint:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI 5 months ago

To fix the problem, add a permissions block to the workflow file. The best way is to add it at the root level (top of the file, after name: and before jobs:), so it applies to all jobs unless overridden. For this workflow, the minimal required permission is likely contents: read, as most jobs only need to check out code and run tests/linting. If any job needs additional permissions (e.g., to create issues or pull requests, or to publish releases), those can be added at the job level. Since the gem publishing step is commented out, we do not need to grant write permissions for now. The change should be made at the top of .github/workflows/ci.yml, after the name: line.

Suggested changeset 1
.github/workflows/ci.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -1,3 +1,5 @@
+permissions:
+  contents: read
 name: CI
 
 on:
EOF
@@ -1,3 +1,5 @@
permissions:
contents: read
name: CI

on:
Copilot is powered by AI and may make mistakes. Always verify output.
Comment on lines +51 to +79
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ env.RUBY_VERSION }}
bundler-version: ${{ env.BUNDLER_VERSION }}
bundler-cache: true

- name: Install dependencies
run: |
bundle install

- name: Run RuboCop with auto-correct
run: |
bundle exec rake rubocop:autocorrect

# TODO: Uncomment this when we have a way a fix for all RuboCop violations
# - name: Check for RuboCop violations
# run: |
# bundle exec rubocop --fail-level W

- name: Ensure no changes to git-tracked files
run: git --no-pager diff --exit-code

security:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI 5 months ago

To fix the problem, add a permissions block at the top level of the workflow file, immediately after the name and before the on key. This will apply the least privilege principle to all jobs in the workflow, ensuring that the GITHUB_TOKEN only has read access to repository contents unless otherwise specified. The recommended minimal setting is permissions: { contents: read }. No changes to job steps or additional imports are required. This change is made at the root of .github/workflows/ci.yml.


Suggested changeset 1
.github/workflows/ci.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -1,3 +1,5 @@
+permissions:
+  contents: read
 name: CI
 
 on:
EOF
@@ -1,3 +1,5 @@
permissions:
contents: read
name: CI

on:
Copilot is powered by AI and may make mistakes. Always verify output.
Comment on lines +80 to +100
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ env.RUBY_VERSION }}
bundler-version: ${{ env.BUNDLER_VERSION }}
bundler-cache: true

- name: Install dependencies
run: |
bundle install

- name: Run bundle audit
run: |
bundle exec bundle audit check --update

gem-publish:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI 5 months ago

To fix the problem, you should add a permissions block to the workflow file, either at the root level (to apply to all jobs) or to each job individually. The best approach is to add it at the root level, specifying the minimal permissions required for the workflow to function. For most CI workflows that only need to read repository contents (e.g., for checkout and running tests), contents: read is sufficient. If any job requires additional permissions (e.g., to create pull requests or publish packages), you can override the permissions at the job level. In this case, none of the jobs appear to require write access, so adding permissions: contents: read at the root is the best fix. This should be added after the name and before the on block for clarity and convention.

Suggested changeset 1
.github/workflows/ci.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -1,3 +1,5 @@
+permissions:
+  contents: read
 name: CI
 
 on:
EOF
@@ -1,3 +1,5 @@
permissions:
contents: read
name: CI

on:
Copilot is powered by AI and may make mistakes. Always verify output.
Comment on lines +101 to +130
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'
needs: [test, lint, security]
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ env.RUBY_VERSION }}
bundler-version: ${{ env.BUNDLER_VERSION }}
bundler-cache: true

- name: Install dependencies
run: |
bundle install

- name: Build gem
run: |
bundle exec rake build

# TODO: Uncomment this when we are ready to publish to RubyGems
# - name: Publish to RubyGems
# run: |
# gem push pkg/*.gem
# env:
# RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI 5 months ago

To fix the problem, add a permissions block at the top level of the workflow file, immediately after the name field and before the on field. This will apply the least-privilege permissions (contents: read) to all jobs in the workflow, unless a job explicitly overrides it. This change does not affect the existing functionality of the workflow, as none of the jobs require write access to repository contents or other resources. No additional methods, imports, or definitions are needed.


Suggested changeset 1
.github/workflows/ci.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -1,3 +1,5 @@
+permissions:
+  contents: read
 name: CI
 
 on:
EOF
@@ -1,3 +1,5 @@
permissions:
contents: read
name: CI

on:
Copilot is powered by AI and may make mistakes. Always verify output.
fern-api bot and others added 12 commits August 19, 2025 14:56
* enable catalog test

* modify test setup

* messy status

* current state

* fix typo in multipart request

* simplify state

* progress, some nested values converting

* progress, some nested values converting

* log in coerce

* restore request

* request succeeds

* remove logging from client and raw client

* test passes, response parsed

* update catalog client

* add verbose mode handling in integration test helper

---------

Co-authored-by: jsklan <jsklan.development@gmail.com>
* restructure directory

* migrate structure

* migrate inventory test

* fix client batch_upsert url

* skip all tests

* update verbose request logs

* simplify endpoint calls

* rake test passes, 63 tests skipped

* update inventory client and test

---------

Co-authored-by: jsklan <jsklan.development@gmail.com>
* interim commit

* utils

* tests passing

* polish

---------

Co-authored-by: jsklan <jsklan.development@gmail.com>
* cash, catalog, customers groups

* cleanup

---------

Co-authored-by: jsklan <jsklan.development@gmail.com>
Co-authored-by: jsklan <jsklan.development@gmail.com>
@fern-support fern-support changed the title do not merge: Square Ruby SDK feat: introduce new major version of the Square Ruby SDK Aug 21, 2025
@fern-api fern-api bot force-pushed the fern-api/square-ruby-sdk-v44 branch from bded989 to ebe59a4 Compare August 21, 2025 15:49
#172)

* README updates with a license change to match the repoin gemspec file

* Removing duplicate block code start
@Barry-Zou Barry-Zou merged commit c2db04d into master Aug 21, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants