Skip to content
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

chore: Backport #345 to 7-0-stable #355

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open

chore: Backport #345 to 7-0-stable #355

wants to merge 17 commits into from

Conversation

BuonOmo
Copy link
Collaborator

@BuonOmo BuonOmo commented Nov 22, 2024

This Pull Request is not there to be merged, but to run tests and have the usual review process before publish a 7.0 compatible backport for this commit.

@shaunma
Copy link

shaunma commented Jan 22, 2025

@BuonOmo Do you by any chance have updates on the status of the backport?

@BuonOmo
Copy link
Collaborator Author

BuonOmo commented Jan 22, 2025

@shaunma sorry for the latency here. I'm making the tests pass so that we could go on with the PR.

You can always pinpoint the 7-0-stable branche in your Gemfile to not be stuck in the meantime:

gem "activerecord-cockroachdb-adapter", github: "cockroachdb/activerecord-cockroachdb-adapter", branch: "7-0-stable"

@BuonOmo BuonOmo force-pushed the 7-0-stable branch 8 times, most recently from a350e5e to 112b7eb Compare January 22, 2025 19:12
BuonOmo and others added 12 commits January 23, 2025 11:07
This fixes the `IOError` we could encounter in tests.

Found using:

```ruby
def bugmsg(header, stdout)
  bugged = begin; print; rescue IOError; "💥 "; end
  STDOUT.puts "🤞#{header.rjust(17)}: stdout=#{stdout.inspect} " \
    "#{bugged}(at #{caller_locations(2, 1).first})"
end

trace_var :$stdout, (proc { bugmsg("$stdout=", _1) })

TracePoint.trace(:a_return) do |tp|
  next unless tp.method_id == :reopen && tp.self == $stdout
  bugmsg("$stdout#reopen", $stdout)
end
```
This fixes the test
`#test_all_foreign_keys_valid_having_foreign_keys_in_multiple_schemas`.
- Allow using various schemas for the console,
  and always start with a clean slate.
- If no internet, select latest used Rails version.
- Allow to easily show schema loading logs.
- Closer CRDB configuration between CI and local dev.
- Add editor config file.
Previously the action would be executed twice, once by a push event and
once by a pull_request event.
This wrapper job will have a stable name, so it's easy to configure a
required check on it.
Avoid 87% of the `#disable_referential_integrity` calls made
in fixture setup by just trying first without disabling and
just disabling in case of failure. Also batch foreign keys
removals and addition (for clarity only).
@BuonOmo
Copy link
Collaborator Author

BuonOmo commented Jan 23, 2025

NOTE: I backported a lot of test related commits to be sure we have tests passing (or close to be passing, as they weren't always passing at that time)

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.

3 participants