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) and expand CouchDB version checks #2

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

Conversation

drhuffman12
Copy link

@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 (as of v3.1.1):

{
  "couchdb":"Welcome",
  "version":"3.X.X",
  "git_sha":"GIT_SHA_GOES_HERE",
  "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.
  • Tested locally w/ 3.x.x and via CircleCI w/ 2.x.x

-[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).

drhuffman12/ci_matrix CouchDB (2.x? and 3.x?) (#2) adds CI test runs for matrix CouchDB (2.x? and 3.x?):

  • Expand the CI to run the tests against a 'matrix' of version combo's made up of the:
    • latest 2 versions of CouchDB (2.x? and 3.x?)

* drhuffman12/upgrade_to_crystal_1.1.1 "json_mapping" is now a shard (crystal-lang/crystal#9527); (Refactor to use JSON::Serializable instead?)

* drhuffman12/upgrade_to_crystal_1.1.1 avoid "Missing ENV key" errors; add more db conn env var's

* drhuffman12/upgrade_to_crystal_1.1.1 TODO: Why "CouchDB::Response::Vendor#version" not getting parsed in?

* drhuffman12/upgrade_to_crystal_1.1.1 Allow CouchDB '3.x.x' (not just '2.x.x'). (TODO: Add applicable tests for '3.x.x' changes.); TODO: Why "CouchDB::Response::Vendor#version" not getting parsed in?

* drhuffman12/upgrade_to_crystal_1.1.1 Bump shard version to "0.4.0"; comment out Crystal version requirement (note compatibility elsewhere?)

* drhuffman12/upgrade_to_crystal_1.1.1 cleanup re `Vendor#version`

* drhuffman12/upgrade_to_crystal_1.1.1 Add myself as a contributor.
@drhuffman12
Copy link
Author

Hi @vectorselector / @TechMagister, Thanks for all the groundwork on this shard! Please review these changes.

I got the tests to pass for use with:

  • Crystal 1.1.1 (local) and 1.2.0-dev (CircleCI)
  • CouchDB 2.x.x (CircleCI) / CouchDB 3.x.x (local)

I'm kinda new to CouchDB. I looked at it years ago and am finally circling back to it. So, Next I'll be reading/reviewing CouchDB tutorials and testing/making an example Crystal-based app with CouchDB.

* drhuffman12/ci_matrix initial prep

* drhuffman12/ci_matrix Copy Github CI w/ matrix re multiple Crystal versions. TODO: edit to include multiple CouchDB versions (or at least one 'latest')

* drhuffman12/ci_matrix Copy over "scripts/regen_docs".

* drhuffman12/ci_matrix Add 'docs' folder.

* drhuffman12/ci_matrix Expand tests for "CouchDB::VERSION"

* drhuffman12/ci_matrix Re-gen doc's and add to repo.

* drhuffman12/ci_matrix Matrix-ize CouchDB 2 vs 3 checks in CircleCI

* drhuffman12/ci_matrix Disable Github Workflows/Actions; trying CircleCI matrix instead.

* drhuffman12/ci_matrix remove github workflow related files (no longer needed)
@drhuffman12 drhuffman12 changed the title Drhuffman12/upgrade to crystal 1.1.1 (and 1.2.0-dev) (#1) Drhuffman12/upgrade to crystal 1.1.1 (and 1.2.0-dev) (#1) and expand CouchDB version checks 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