-
Notifications
You must be signed in to change notification settings - Fork 45
feat: introduce new major version of the Square Ruby SDK #158
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
Conversation
* 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>
… runtime libraries
| 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
Show autofix suggestion
Hide autofix suggestion
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.
-
Copy modified lines R1-R2
| @@ -1,3 +1,5 @@ | ||
| permissions: | ||
| contents: read | ||
| name: CI | ||
|
|
||
| on: |
| 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
Show autofix suggestion
Hide autofix suggestion
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.
-
Copy modified lines R1-R2
| @@ -1,3 +1,5 @@ | ||
| permissions: | ||
| contents: read | ||
| name: CI | ||
|
|
||
| on: |
| 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
Show autofix suggestion
Hide autofix suggestion
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.
-
Copy modified lines R1-R2
| @@ -1,3 +1,5 @@ | ||
| permissions: | ||
| contents: read | ||
| name: CI | ||
|
|
||
| on: |
| 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
Show autofix suggestion
Hide autofix suggestion
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.
-
Copy modified lines R1-R2
| @@ -1,3 +1,5 @@ | ||
| permissions: | ||
| contents: read | ||
| name: CI | ||
|
|
||
| on: |
* 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>
bded989 to
ebe59a4
Compare
#172) * README updates with a license change to match the repoin gemspec file * Removing duplicate block code start
This PR is for the
v44release of the Ruby SDK, generated using Fern.