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

Drhuffman12/upgrade to crystal 1.1.1 (and 1.2.0-dev) #1

Merged
merged 7 commits into from
Sep 6, 2021

Conversation

drhuffman12
Copy link
Owner

@drhuffman12 drhuffman12 commented Sep 6, 2021

-[x] Add dependency of crystal-lang/json_mapping.cr/ (JSON.mapping was deprecated and moved to shard.)

-[x] Add more environment variables for database connection settings with defaults.

  • For now, just for tests:
      un = ENV.keys.includes?("TEST_DB_UN") ? ENV["TEST_DB_UN"] : "admin"
      pw = ENV.keys.includes?("TEST_DB_PW") ? ENV["TEST_DB_PW"] : "password"
      ip = ENV.keys.includes?("TEST_DB_IP") ? ENV["TEST_DB_IP"] : "localhost"
      port = ENV.keys.includes?("TEST_DB_PORT") ? ENV["TEST_DB_PORT"] : "5984"
      couchdb_url = ENV.keys.includes?("TEST_DB") ? ENV["TEST_DB"] : "http://#{un}:#{pw}@#{ip}:#{port}"
    

-[x] DEPRECATION: Use ServerInfo#version instead of Vendor#version.
As of v3.x (or earlier?), a call to the server's root (e.g.: GET http://127.0.0.1:5984/)
no longer returns version inside vendor.
In v3.x, response will instead look like:

{
  "couchdb":"Welcome",
  "version":"3.1.1",
  "git_sha":"ce596c65d",
  "uuid":"SOME_UUID_GOES_HERE",
  "features":["access-ready","partitioned","pluggable-storage-engines","reshard","scheduler"],
  "vendor":{"name":"The Apache Software Foundation"}
}

-[x] Allow 3.x.x versions of CouchDB.

  • Add is_v2? and is_v3? methods to CouchDB::Response::ServerInfo.

-[x] Remove hard-coded crystal key/version from shard.yml (for now).

  • Tested (and passed)
    • locally w/ Crystal 1.1.1 [6d9a1d583] (2021-07-26)
    • via CircleCI w/ Crystal 1.2.0-dev [cadc4b3c7] (2021-09-02)

-[x] Bump version of this shard to 0.4.0

  • Set CouchDB::VERSION based on shard version value in from shard.yml (to avoid out-of-sync issues).

Next steps... see also:

@drhuffman12 drhuffman12 marked this pull request as ready for review September 6, 2021 09:02
@drhuffman12 drhuffman12 merged commit 4e4c9b5 into master Sep 6, 2021
@drhuffman12 drhuffman12 changed the title Drhuffman12/upgrade to crystal 1.1.1 Drhuffman12/upgrade to crystal 1.1.1 (and 1.2.0-dev) Sep 6, 2021
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.

1 participant