René's URL Explorer Experiment


Title: fix(generator): don't require a database to generate a schema by mortik · Pull Request #47 · openapi-ruby/openapi-ruby · GitHub

Open Graph Title: fix(generator): don't require a database to generate a schema by mortik · Pull Request #47 · openapi-ruby/openapi-ruby

X Title: fix(generator): don't require a database to generate a schema by mortik · Pull Request #47 · openapi-ruby/openapi-ruby

Description: Follow-up to #45. Same theme: loading the consumer's test files to collect declarations shouldn't drag in the rest of the test environment. Problem The document is built entirely from path / api_path declarations and component classes — nothing reads the database. But generation loads the consumer's test files, and rails/test_help:13 calls maintain_test_schema! at require time, which opens a connection. Many hand-written helpers also add ActiveRecord::Migration.check_all_pending!. Net effect: generating a document that never touches the database still required one running — so a CI schema-check job needs a Postgres service purely to produce a YAML file. Fix Stub maintain_test_schema! and check_all_pending! on ActiveRecord::Migration for the generation subprocess, via an ActiveSupport.on_load(:active_record) hook installed before any consumer file is required. It patches the methods rather than clearing ActiveRecord.maintain_test_schema, which was my first attempt and does not work: the flag is reapplied from app config by the active_record.set_configs initializer, which runs after any load hook registerable from the script, so it's silently undone before rails/test_help reads it. Only the schema check is skipped. A connection is still available for declarations that genuinely need one (an enum built from a query at load time); such a suite needs a database either way. Verification Against a Rails 8.1 app (fixtures, ~120 tests, both call sites present in test_helper.rb), schema deleted before each run: before after rake openapi_ruby:generate, no DB reachable ActiveRecord::ConnectionNotEstablished, no file written succeeds, byte-identical document Isolated the two causes by removing them one at a time: silencing maintain_test_schema! alone left the consumer's check_all_pending! connecting, which is why both are covered. No leakage — outside generation MigrationSilencer is absent from ActiveRecord::Migration.singleton_class.ancestors, and that app's full suite is unaffected (120 runs, 0 failures). 320 examples, 0 failures; standardrb clean. 🤖

Open Graph Description: Follow-up to #45. Same theme: loading the consumer's test files to collect declarations shouldn't drag in the rest of the test environment. Problem The document is built entirely from path ...

X Description: Follow-up to #45. Same theme: loading the consumer's test files to collect declarations shouldn't drag in the rest of the test environment. Problem The document is built entirely fr...

Opengraph URL: https://github.com/openapi-ruby/openapi-ruby/pull/47

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:d4e11184-9c5d-57a7-b2c9-74957e97aab2
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idA6C6:2463BD:1CBD9D6:24BA37F:6B014B85
html-safe-noncec5d0021767a3bc516bafe04c484ac1e12fc2f2414f9b52519ffca6b8a35c1c89
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNkM2OjI0NjNCRDoxQ0JEOUQ2OjI0QkEzN0Y6NkIwMTRCODUiLCJ2aXNpdG9yX2lkIjoiNzgzMTgxMTExNzMwNjQzMjM4OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac07c77e67401ff0a0e5867aa1c519e3e4edaf787ff328689ec15595e212c33a21
hovercard-subject-tagpull_request:4242890444
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/openapi-ruby/openapi-ruby/pull/47/files
twitter:imagehttps://avatars.githubusercontent.com/u/517703?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/517703?s=400&v=4
og:image:altFollow-up to #45. Same theme: loading the consumer's test files to collect declarations shouldn't drag in the rest of the test environment. Problem The document is built entirely from path ...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/openapi-ruby/openapi-ruby git https://github.com/openapi-ruby/openapi-ruby.git
octolytics-dimension-user_id276587259
octolytics-dimension-user_loginopenapi-ruby
octolytics-dimension-repository_id1211860664
octolytics-dimension-repository_nwoopenapi-ruby/openapi-ruby
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1211860664
octolytics-dimension-repository_network_root_nwoopenapi-ruby/openapi-ruby
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/openapi-ruby/openapi-ruby/pull/47/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fopenapi-ruby%2Fopenapi-ruby%2Fpull%2F47%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fopenapi-ruby%2Fopenapi-ruby%2Fpull%2F47%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=openapi-ruby%2Fopenapi-ruby
Reloadhttps://github.com/openapi-ruby/openapi-ruby/pull/47/files
Reloadhttps://github.com/openapi-ruby/openapi-ruby/pull/47/files
Reloadhttps://github.com/openapi-ruby/openapi-ruby/pull/47/files
openapi-rubyhttps://github.com/openapi-ruby
openapi-rubyhttps://github.com/openapi-ruby/openapi-ruby
Codehttps://github.com/openapi-ruby/openapi-ruby
Issues1 (1)https://github.com/openapi-ruby/openapi-ruby/issues
Pull requests2 (2)https://github.com/openapi-ruby/openapi-ruby/pulls
Actionshttps://github.com/openapi-ruby/openapi-ruby/actions
Projectshttps://github.com/openapi-ruby/openapi-ruby/projects
Security and qualityhttps://github.com/openapi-ruby/openapi-ruby/security
Insightshttps://github.com/openapi-ruby/openapi-ruby/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fopenapi-ruby%2Fopenapi-ruby%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fopenapi-ruby%2Fopenapi-ruby%2Fissues%2Fnew%2Fchoose
mortikhttps://github.com/mortik
mainhttps://github.com/openapi-ruby/openapi-ruby/tree/main
fix/skip-test-schema-maintenancehttps://github.com/openapi-ruby/openapi-ruby/tree/fix/skip-test-schema-maintenance
Conversation 0 https://github.com/openapi-ruby/openapi-ruby/pull/47
Commits 1 https://github.com/openapi-ruby/openapi-ruby/pull/47/commits
Checks 12 https://github.com/openapi-ruby/openapi-ruby/pull/47/checks
Files changed https://github.com/openapi-ruby/openapi-ruby/pull/47/files
Please reload this pagehttps://github.com/openapi-ruby/openapi-ruby/pull/47/files
fix(generator): don't require a database to generate a schema https://github.com/openapi-ruby/openapi-ruby/pull/47/files#top
Show all changes 1 commit https://github.com/openapi-ruby/openapi-ruby/pull/47/files
379b57c fix(generator): don't require a database to generate a schema mortik Aug 10, 2026 https://github.com/openapi-ruby/openapi-ruby/pull/47/commits/379b57c879bb56ddf657833bef0aa77882ff21cb
Clear filters https://github.com/openapi-ruby/openapi-ruby/pull/47/files
Please reload this pagehttps://github.com/openapi-ruby/openapi-ruby/pull/47/files
Please reload this pagehttps://github.com/openapi-ruby/openapi-ruby/pull/47/files
README.md https://github.com/openapi-ruby/openapi-ruby/pull/47/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5
rake_task_support.rb https://github.com/openapi-ruby/openapi-ruby/pull/47/files#diff-34fd677c2d3771efe70fb05a92c0f9d117f33396f2a03009214214d1c0850bb7
test_schema_suppressor.rb https://github.com/openapi-ruby/openapi-ruby/pull/47/files#diff-5396381af2b71f42b2685f306f2d517f3f83e478af1f3822185b5bc1c774c538
hybrid_generation_spec.rb https://github.com/openapi-ruby/openapi-ruby/pull/47/files#diff-4e969ec99be64ab69df1809392d4d25a82e0da6774716fcaf82169c115425581
test_schema_suppressor_spec.rb https://github.com/openapi-ruby/openapi-ruby/pull/47/files#diff-bc6f1ace35138bde218084096c9a194b0b0f4b55076e12726d07a50a4baf8bdd
README.mdhttps://github.com/openapi-ruby/openapi-ruby/pull/47/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5
View file https://github.com/openapi-ruby/openapi-ruby/blob/379b57c879bb56ddf657833bef0aa77882ff21cb/README.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/openapi-ruby/openapi-ruby/pull/47/{{ revealButtonHref }}
https://github.com/openapi-ruby/openapi-ruby/pull/47/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5
https://github.com/openapi-ruby/openapi-ruby/pull/47/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5
https://github.com/openapi-ruby/openapi-ruby/pull/47/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5
lib/openapi_ruby/generator/rake_task_support.rbhttps://github.com/openapi-ruby/openapi-ruby/pull/47/files#diff-34fd677c2d3771efe70fb05a92c0f9d117f33396f2a03009214214d1c0850bb7
View file https://github.com/openapi-ruby/openapi-ruby/blob/379b57c879bb56ddf657833bef0aa77882ff21cb/lib/openapi_ruby/generator/rake_task_support.rb
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/openapi-ruby/openapi-ruby/pull/47/{{ revealButtonHref }}
https://github.com/openapi-ruby/openapi-ruby/pull/47/files#diff-34fd677c2d3771efe70fb05a92c0f9d117f33396f2a03009214214d1c0850bb7
https://github.com/openapi-ruby/openapi-ruby/pull/47/files#diff-34fd677c2d3771efe70fb05a92c0f9d117f33396f2a03009214214d1c0850bb7
lib/openapi_ruby/generator/test_schema_suppressor.rbhttps://github.com/openapi-ruby/openapi-ruby/pull/47/files#diff-5396381af2b71f42b2685f306f2d517f3f83e478af1f3822185b5bc1c774c538
View file https://github.com/openapi-ruby/openapi-ruby/blob/379b57c879bb56ddf657833bef0aa77882ff21cb/lib/openapi_ruby/generator/test_schema_suppressor.rb
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/openapi-ruby/openapi-ruby/pull/47/{{ revealButtonHref }}
spec/integration/hybrid_generation_spec.rbhttps://github.com/openapi-ruby/openapi-ruby/pull/47/files#diff-4e969ec99be64ab69df1809392d4d25a82e0da6774716fcaf82169c115425581
View file https://github.com/openapi-ruby/openapi-ruby/blob/379b57c879bb56ddf657833bef0aa77882ff21cb/spec/integration/hybrid_generation_spec.rb
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/openapi-ruby/openapi-ruby/pull/47/{{ revealButtonHref }}
https://github.com/openapi-ruby/openapi-ruby/pull/47/files#diff-4e969ec99be64ab69df1809392d4d25a82e0da6774716fcaf82169c115425581
https://github.com/openapi-ruby/openapi-ruby/pull/47/files#diff-4e969ec99be64ab69df1809392d4d25a82e0da6774716fcaf82169c115425581
spec/openapi_ruby/generator/test_schema_suppressor_spec.rbhttps://github.com/openapi-ruby/openapi-ruby/pull/47/files#diff-bc6f1ace35138bde218084096c9a194b0b0f4b55076e12726d07a50a4baf8bdd
View file https://github.com/openapi-ruby/openapi-ruby/blob/379b57c879bb56ddf657833bef0aa77882ff21cb/spec/openapi_ruby/generator/test_schema_suppressor_spec.rb
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/openapi-ruby/openapi-ruby/pull/47/{{ revealButtonHref }}
Please reload this pagehttps://github.com/openapi-ruby/openapi-ruby/pull/47/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.