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

Release 1.20.0 #655

Merged
merged 82 commits into from
Nov 1, 2020
Merged

Release 1.20.0 #655

merged 82 commits into from
Nov 1, 2020

Conversation

DeeDeeG
Copy link
Contributor

@DeeDeeG DeeDeeG commented Oct 31, 2020

Note

Thank you to new contributors @brunoocasali, @GPrimola and @tegandbiscuits!

Happy Hacktoberfest!

Changelog

Bruno Casali (3):
Add a standard EditorConfig configuration for every contributor to follow (#649)
Enhancement/i18n thread safe (#647)
Upgrade puma to latest version 5.x (#641)

DeeDeeG (3):
Finish Upgrading Webpacker to v5 (#637)
Update dependencies for September 2020 (#636)
yarn.lock: Update "http-proxy" to v1.18.1 (fe195d7)

Lucas (2):
Keeping filters state on pagination (#638)
Applying ADA filters for the Map view of search. (#651)

Tegan Rauh (1):
Add rubocop and resolve lint errors (#644)

Checklist

  • Tested Mobile Responsiveness
  • Added Unit Tests
  • CI Passes
  • Deploys to Heroku on test Correctly (Maintainers will handle)
  • Added Documentation (Service and Code when required)

DeeDeeG and others added 30 commits March 31, 2019 16:33
Only applies during development and testing
when we use the "db/export.csv" data.

Doesn't affect production, which uses the real data in its db.
Also, clarify that there are two containers, web and db,
rather than just one; these can be viewed using
docker ps
Add border bottom to give each menu item more separation
Make filter with "focus" class more readable
Does effectively the same things as before,
but now in a simpler/faster way.

Some of the changes take inspiration from
@btyy77c's dockerAlpine branch:
https://github.com/btyy77c/refugerestrooms/blob/dockerAlpine/Dockerfile

The PhantomJS install is based on (mostly copy-pasted from)
@nkovacs' phantomjs image from Docker Hub:
https://github.com/nkovacs/selenium-standalone-phantomjs/blob/c5f6bba218472270/Dockerfile#L19-L22
(Also installs Node.js in /usr/local/
instead of installing Node.js in the root directory.)

With this updated script, we specify just a major version
and the script picks the latest minor/patch version within that.

--

Nodejs.org does most of the work by maintaining the "latest-v[MAJOR]"
folders; We only need to parse the "SHASUMS256.txt" file from there,
and pick the "linux-x64" variant, which works with our Docker setup.

At this point we can use the known directory URL, plus the filename
extracted from "SHASUMS256.txt", and download with curl, or wget, etc.

(e.g. "curl -L https://nodejs.org/dist/latest-v10.x/node-v10.16.0-linux-x64.tar.xz -o nodejs.tar.xz")

--

There is no "latest-LTS" folder or similar, so automatically getting
the latest LTS version would be more difficult.

We could search "nodejs.org/dist/" for folders with
the name "latest-[LETTERS-ONLY-STRING]", which would be the folders
of all the LTS codenames. Among these, the one with
the alphabetically last name is the latest LTS.

This would work at least until around 2040, when they may have
to loop around and re-use some earlier letters (a, b, c, etc.)
* yarn.lock: Update Node.js packages

* Gemfile.lock: Update gems
To fufill the open source agreement, we have to link to bugsnag now in our readme.
We do all the setup/build steps inside a Docker container,
so we don't need ruby tools outside of Docker
(on the Travis CI virtual machine instances).

Should save about 20 seconds of Travis CI build time.

--

Inspired by @btyy77c who did this first at their dockerAlpine branch:
  - btyy77c@393cf46

Documentation at Travis re: minimal/generic images:
  - https://docs.travis-ci.com/user/languages/minimal-and-generic/
This (the Alpine Linux-based postgresql image) is a smaller image
than the debian-based postgresql image,
so it should be marginally faster to download.

Seems like a good idea in general,
to speed up build times (even outside of Travis CI).

Also should save some disk space for developers.

--

Inspired by the general concept of @btyy77c's dockerAlpine branch:
  - https://github.com/btyy77c/refugerestrooms/commits/dockerAlpine

Docker Hub documentation on the alpine vs debian postgres images:
  - https://hub.docker.com/_/postgres#image-variants
This isn't needed anymore,
since we have removed the tumblr link from the footer.
Remove tumblr link from footer html, related places in the code
I noticed we were removing tumblr, here's one more instance
* Create devise.fil.yml

* Update devise.fil.yml

* Update for devise.fil.yml @100% Translation

* Update and rename devise.fil.yml to devise.fl.yml

* Update and rename devise.fl.yml to devise.fil.yml
Translated files from EN to FIL #451
* switched sass-rails gem (sass-rails --> sassc-rails)
DeeDeeG and others added 24 commits March 17, 2020 15:02
* Dockerfile: Use better PhantomJS URL

GitHub's CDN is more reliable than BitBucket's.

(This is the URL we originally used as of PR #435,
which was the initial implementation of our Docker setup.)

* docker-compose.yml: Add password for PostgreSQL db

This is in response to a recent change in the PostgreSQL Docker image.

Either the database must be configured to not check passwords, i.e.
`POSTGRESQL_HOST_AUTH_METHOD=trust`, or a password must now be set.

For explanation and context, see:

- docker-library/postgres#658
- docker-library/postgres#681
- docker-library/postgres#580
- https://discuss.circleci.com/t/postgresql-image-password-not-specified-issue/34555
* Gemfile[.lock]: Update rails to 5.2.4.2

Also update its dependencies, as required.

* Gemfile[.lock]: Update grape and grape-swagger

Also update their dependencies, as needed.

* Gemfile[.lock]: Update activeadmin

* Gemfile: Pin sprockets to "< 4"

The 4.x major version upgrade requires some configuration changes.

Pinning keeps the app from breaking when doing `bundle update`.

* Gemfile.lock: Update all packages

* yarn.lock: Update all packages
* Add server reCAPTCHA verification for contacts

Added a temporary secret key for testing in .env, which is loaded by
the dotenv gem. In production, just put another key in the Heroku
env variable settings.

* Add reCAPTCHA to contacts submission page

* Enable browser form validation by default

This gets form input validated on the client side, which gives faster
feedback to the user, without the need for a custom solution. This
feature is supported in all modern browsers.

* Add reCAPTCHA to restrooms page

* Make stub for reCAPTCHA verification during tests

Co-authored-by: Mikena Wood <[email protected]>
* application_controller.rb: Adjust set_locale logic

Adds a :locale parameter (which should come from the URL, e.g.:
`refugerestrooms.org/?locale=en` or something like that.)

* application_controller.rb: set up default_url_options

Allows URLs auto-generated by Rails to automatically be expanded
to include "?locale=xyz" or "&locale=xyz"

See: https://guides.rubyonrails.org/v5.2.4/i18n.html#setting-the-locale-from-url-params

For example, this affects URLs made with ActionView URL helpers
('button_to', 'link_to', etc.)

See: https://api.rubyonrails.org/v5.2.4/classes/ActionView/Helpers/UrlHelper.html

(Hard-coded URLS will generally not get the parameter added.)

* header: Use link_to helper for homepage link

Use a link_to helper to dynamically create the homepage link,
because URL helpers now automatically include the 'locale=' parameter.

* header: Un-hard-code the api docs path

Use the 'api_docs_path' helper, rather than hard-coding '/api/docs'.

(This is for the navigation header, under the "Resources" drop-down.)

* config/routes.rb: Add (optional) locale scope to all pages

Adds an optional locale prefix for almost every page in the app.

See: https://guides.rubyonrails.org/v5.2.4/i18n.html#setting-the-locale-from-url-params

You can now visit e.g. '/es/restrooms/new' and you will see the
"Submit a New Restroom" page in Spanish.

All links in the app auto-generate this locale prefix,
so users can specify a locale via visiting a specific locale prefix,
and the links in the app will not misdirect them into another locale.

(You can still visit URLs without a locale prefix,
like '/restrooms/new', and the app will simply auto-detect the locale
based on the preferred languages in your browser settings.)

This preserves the existing URLs in working order,
and any links out there on the web, or in people's bookmarks,
will still work.)

The home page does not always get the prefix:
- The home page link in nav is just '/?locale=[I18n.locale]'
  - You can visit '/?locale=es' to see the homepage in Spanish.
  - The homepage link in the nav are auto-generated
    as '/?locale=[I18n.locale]'; This is equivalent in functionality
    to the locale prefixes (e.g. '/es/').
  - The homepage links in the footer are auto-generated as
    '/[I18n.locale]/'.
  - You can visit '/es/' to see the homepage in Spanish.

* _footer.html.haml: Add locale switcher links

Adds locale switcher links in the footer,
which displays at the bottom of every page.

These links dynamically link to the current page the user is viewing,
but with the current locale overridden with a specific, new locale.

Uses the Rails API's "ActionDispatch::Request" feature
to get a string containing the last requested page,
(i.e. the page the user is currently viewing).
This includes query parameters, such as "?lat=[num]&long=[num]"

See: https://api.rubyonrails.org/v5.2.4/classes/ActionDispatch/Request.html#method-i-GET

(Parameters can also be derived from the URL,
such as the "es/" in "/es/restrooms/new", if routed properly.)

See: https://guides.rubyonrails.org/routing.html

See these StackOverflow answers/this Wikipedia article for details:
- https://stackoverflow.com/questions/3762430/rails-preserving-get-query-string-parameters-in-link-to
- https://stackoverflow.com/questions/6885990/rails-params-explained
- https://en.wikipedia.org/wiki/Query_string

* CSS: Better styling of the locale-switcher links

Spaced out the links a bit, and added bullet-point separators.

* spec: Fix a path construction, test passes now

Passing the whole array of restroom data was causing the whole
array to be erroneously interpreted as if it was the :locale
prefix in the path.

Explicitly pass :id, and only :id,
to the `restroom_path` route helper for this test.

(We only need the :id from the newly-constructed test restroom
in order to visit the correct path. Other restroom data isn't
needed here anyhow.)
(This PR still needs some work.)

This reverts commit aed3e1e.
* dependencies: Update puma and jquery

* dependencies: Bump Kaminari and Rails
* Add reference to docker troubleshooting wiki in contributing documentation

* Update CONTRIBUTING.md
Docker Desktop for Window requires Windows 10 64-bit,
"Professional" or "Enterprise" editions.
* dependencies: Bump geocoder, websocket-extensions

* Gemfile.lock: Update rack to 2.2.3
This one apparently will NOT expire.
* Gemfile[.lock]: Update webpacker to 5.2.1

* Webpacker: Update config files

  Ran "rails webpacker:install" and committed the changes.

  In "config/webpacker.yml,"
  kept the ".js.erb" entry under "extensions:"
  so that "app/javascript/packs/lib/maps.js.erb" is included.

  In "config/webpack/environment.js,"
  kept jQuery and rails-erb-loader configs,
  as we are still using these.

* JS dependencies: Upgrade webpack-dev-server

  Commit the changes from running `rails webpacker:install`,
  but using a caret "^" semver range for "@rails/webpacker",
  rather than an exact version.

  (So that we get updates in the 5.x series)
* dependencies: Remove `swagger` node module

   We don't actually use this.

   Also removes 200 sub-dependencies,
   and makes our yarn.lock file about 1270 lines shorter!

* yarn.lock: Upgrade bootstrap to 4.5.2

   (Was at version 4.4.1)

* dependencies: Resolve node-fetch to ^2.6.1

* yarn.lock: Upgrade "selfsigned" and "node-forge"

* Gemfile[.lock]: Update Rails and dependencies

   rails was 5.2.4.3, now it's version 5.2.4.4
* Keeping filters state on pagination

* Fix Code Climates complaints.

* Fixed active issue on ada filter buttons

* Fixed undefined function problem when run rspec.
* Initialize rubocop

* Run rubocop with --fix

* Don't require magic comment

  This will affect every file and have potential side effects, so I'm
  going to start with this turned off.

* Resolve lint errors in `app`

* RSpec linting

* Resolve remaining

* Fix wrong change

* Singleton method for verify

* New lint rules

* Add rubocop to travis config

* Correct docker compose command

* Check for geo

  The condition was actually supposed to be `if geo = results.first`,
  because that's not always obvious the intention and fails lint, I'm just
  doing a truthy check for it which should be the same.

* Fix typo

* Add contributing docs for rubocop
* Applying ADA filters for the Map view of search.

* Changed comment for polyfill URLSearchParams

* Fixed bug of map marker content not showing.
* Provide a way to respond requests without thread-safe issues

  As rails docs says https://guides.rubyonrails.org/i18n.html#managing-the-locale-across-requests
  When we use 'I18n.locale =' the current locale could leak into following requests
  this is a standard and recommended way to deal with it :)

* Create a shared_example to test I18n locale switching

* Update spec/controllers/pages_controller_spec.rb
@DeeDeeG DeeDeeG added Release Hacktoberfest These are issues or pull requests related to Hacktoberfest (https://hacktoberfest.digitalocean.com/) labels Oct 31, 2020
@DeeDeeG
Copy link
Contributor Author

DeeDeeG commented Oct 31, 2020

This (or similar) should be the commit text when squashing and merging:

* Finish Upgrading Webpacker to v5 (#637)
  - Gemfile[.lock]: Update webpacker to 5.2.1
  - Webpacker: Update config files
      Ran "rails webpacker:install" and committed the changes.

      In "config/webpacker.yml,"
      kept the ".js.erb" entry under "extensions:"
      so that "app/javascript/packs/lib/maps.js.erb" is included.

      In "config/webpack/environment.js,"
      kept jQuery and rails-erb-loader configs,
      as we are still using these.
  - JS dependencies: Upgrade webpack-dev-server
      Commit the changes from running `rails webpacker:install`,
      but using a caret "^" semver range for "@rails/webpacker",
      rather than an exact version.

      (So that we get updates in the 5.x series)


* Update dependencies for September 2020 (#636)
  - dependencies: Remove `swagger` node module
      We don't actually use this.

      Also removes 200 sub-dependencies,
      and makes our yarn.lock file about 1270 lines shorter!
  - yarn.lock: Upgrade bootstrap to 4.5.2
      (Was at version 4.4.1)
  - dependencies: Resolve node-fetch to ^2.6.1
  - yarn.lock: Upgrade "selfsigned" and "node-forge"
  - Gemfile[.lock]: Update Rails and dependencies
      rails was 5.2.4.3, now it's version 5.2.4.4


* Keeping filters state on pagination (#638)
  - Keeping filters state on pagination
  - Fix Code Climates complaints.
  - Fixed active issue on ada filter buttons
  - Fixed undefined function problem when run rspec.


* Add rubocop and resolve lint errors (#644)
  - Initialize rubocop
  - Run rubocop with --fix
  - Don't require magic comment
      This will affect every file and have potential side effects, so I'm
      going to start with this turned off.
  - Resolve lint errors in `app`
  - RSpec linting
  - Resolve remaining
  - Fix wrong change
  - Singleton method for verify
  - New lint rules
  - Add rubocop to travis config
  - Correct docker compose command
  - Check for geo
      The condition was actually supposed to be `if geo = results.first`,
      because that's not always obvious the intention and fails lint, I'm just
      doing a truthy check for it which should be the same.
  - Fix typo
  - Add contributing docs for rubocop


* Applying ADA filters for the Map view of search. (#651)
  - Applying ADA filters for the Map view of search.
  - Changed comment for polyfill URLSearchParams
  - Fixed bug of map marker content not showing.


* Add a standard EditorConfig configuration for every contributor to follow (#649)


* Enhancement/i18n thread safe (#647)
  - Provide a way to respond requests without thread-safe issues
      As rails docs says https://guides.rubyonrails.org/i18n.html#managing-the-locale-across-requests
      When we use 'I18n.locale =' the current locale could leak into following requests
      this is a standard and recommended way to deal with it :)
  - Create a shared_example to test I18n locale switching
  - Update spec/controllers/pages_controller_spec.rb


* Upgrade puma to latest version 5.x (#641)


* yarn.lock: Update "http-proxy" to v1.18.1 (fe195d7)


Co-authored-by: Lucas <[email protected]>
Co-authored-by: Tegan Rauh <[email protected]>
Co-authored-by: Bruno Casali <[email protected]>

@DeeDeeG DeeDeeG merged commit 6d072be into master Nov 1, 2020
@DeeDeeG DeeDeeG deleted the release-1.20.0 branch November 1, 2020 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Hacktoberfest These are issues or pull requests related to Hacktoberfest (https://hacktoberfest.digitalocean.com/) Release
Projects
None yet
Development

Successfully merging this pull request may close these issues.