Skip to content

Support sending gcode or SL1 to PrusaLink machines#6432

Merged
Floppy merged 2 commits into
mainfrom
prusa-link
Jun 19, 2026
Merged

Support sending gcode or SL1 to PrusaLink machines#6432
Floppy merged 2 commits into
mainfrom
prusa-link

Conversation

@Floppy

@Floppy Floppy commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

Resolves #6435.

This PR is a simple example of how to implement a new print API service. If you want to implement another one, follow these steps:

  1. Copy the spec file and change the various names at the top of the file - most of the actual tests shouldn't need changing, at least at first.
  2. Put endpoint and credentials in .env.test.local so you can talk to the API
  3. If your API is running on localhost, temporarily comment out config.ignore_localhost = true in spec/support/vcr.rb but don't commit it
  4. Copy a print service in app/services/print and implement the changes for your new service
  5. API interactions will be recorded by vcr so it can be tested without the real API. Remove the :vcr metadata tag at the start of your test file to disable this while you're developing, but put it back when you're done to record the test interactions. Make sure the filtering has worked and that the credentials you've used for development aren't in the cassettes.
  6. Run bundle exec i18n-tasks add-missing --nil-value. That should add the new translation key for your service name. Set the name in en.yml and leave the rest blank. I actually forgot to do this in this PR because I forgot to change the i18n-tasks-use line; see Improve and fix translation strings for printing feature #6452 for the changes to expect.
  7. Once it's all working, remove the credentials set in .env.test.local and make sure the tests pass against the cassettes.
  8. Run bundle exec rubocop -a to autofix any style differences.
  9. Open a PR, and have a cup of tea to celebrate 🎉

@Floppy Floppy added the feature User-facing features and product enhancements label Jun 19, 2026
@codacy-production

codacy-production Bot commented Jun 19, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 14 complexity

Metric Results
Complexity 14

View in Codacy

🟢 Coverage 100.00% diff coverage · +0.07% coverage variation

Metric Results
Coverage variation +0.07% coverage variation (-1.00%)
Diff coverage 100.00% diff coverage

View coverage diff in Codacy

Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (266313c) 7385 6170 83.55%
Head commit (68306d1) 7416 (+31) 6201 (+31) 83.62% (+0.07%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#6432) 31 31 100.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@Floppy Floppy enabled auto-merge June 19, 2026 10:52
@Floppy Floppy merged commit 6dcadbc into main Jun 19, 2026
17 checks passed
@Floppy Floppy deleted the prusa-link branch June 19, 2026 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature User-facing features and product enhancements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Print via PrusaLink legacy API

1 participant