Remove ChatGPT integration and stop generating social media snippets#39
Merged
Conversation
Drop the ruby-openai dependency and the OpenAI-backed generation pipeline on Link. Links no longer generate social media snippets on create; the after_create callback and the OpenAI client/prompt code are removed. The SocialMediaSnippet model, its table, and the display of any existing snippets are kept intact, so previously generated records still render. Specs that stubbed the now-removed fetch_social_media_snippets are updated (verify_partial_doubles would otherwise fail on the missing method). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request removes the application’s OpenAI/ChatGPT-based snippet generation that previously ran automatically when a Link was created, eliminating the external API dependency while keeping previously generated SocialMediaSnippet records renderable.
Changes:
- Removed the
ruby-openaigem from Bundler dependencies. - Deleted the
Linkafter_createcallback and all OpenAI client/prompt code used to generate snippets. - Updated specs by removing stubs for the now-deleted snippet-fetching method.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| app/models/link.rb | Removes the after_create callback and OpenAI snippet generation methods. |
| Gemfile | Drops the ruby-openai gem declaration. |
| Gemfile.lock | Removes ruby-openai from the resolved gem set and dependencies list. |
| spec/controllers/shares_controller_spec.rb | Removes stubbing and fixture text tied to snippet generation. |
| spec/models/share_spec.rb | Removes stubbing of the deleted Link snippet-fetching method. |
| spec/requests/api_links_spec.rb | Removes stubbing of the deleted Link snippet-fetching method in request specs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Removes the ChatGPT (OpenAI) integration and stops generating social media snippets when a
Linkis created.Why
We no longer want to depend on the OpenAI API or auto-generate snippets on
Linkcreation.Changes
ruby-openaidependency fromGemfile/Gemfile.lock.after_create :create_chat_gpt_snippetscallback and the OpenAI client/prompt code fromLink(create_chat_gpt_snippets,fetch_social_media_snippets,gpt_prompt). No moreOPEN_AI_ACCESS_TOKENusage.fetch_social_media_snippets(withverify_partial_doubles = true, stubbing a missing method would fail).Kept intentionally
The
SocialMediaSnippetmodel, its table, the association, and the show-page / JSON-API display of existing snippets are left intact, so previously generated records still render. The goal was to stop generating, not to delete existing data.Notes
app/views/links/show.html.erbstill tells users existing snippets "are created by Open AI." That copy is accurate for legacy records and only renders when snippets exist, so it was left as-is. Happy to reword or hide it if preferred.Testing
bundle exec rspec— 54 examples, 0 failures.🤖 Generated with Claude Code