From f905c7a01e6824881d55c208c927f008e6fb8bd0 Mon Sep 17 00:00:00 2001 From: Jeffrey Warren Date: Tue, 30 Jun 2020 14:45:25 -0400 Subject: [PATCH] more master => main changes (#8096) --- .github/ISSUE_TEMPLATE/--weekly-check-in.md | 2 +- .travis.yml | 2 +- CONTRIBUTING.md | 4 +-- Dangerfile | 6 ++--- README.md | 30 ++++++++++----------- app/controllers/application_controller.rb | 2 +- doc/API.md | 16 +++++------ doc/DATA_MODEL.md | 2 +- doc/EMAIL.md | 10 +++---- doc/LOGIN_SYSTEMS.md | 8 +++--- doc/OPENID.md | 2 +- doc/TESTING.md | 10 +++---- doc/reply_by_tweet.md | 4 +-- 13 files changed, 49 insertions(+), 49 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/--weekly-check-in.md b/.github/ISSUE_TEMPLATE/--weekly-check-in.md index 9ca4985bda..16a9ff65ad 100644 --- a/.github/ISSUE_TEMPLATE/--weekly-check-in.md +++ b/.github/ISSUE_TEMPLATE/--weekly-check-in.md @@ -11,7 +11,7 @@ Hi everybody! 👏 We all at Public Lab 🎈 - learn, grow, work, brainstorm ideas, contribute together so why not share about our weekly goals and the awesome work we have done at Public Lab with each other, so we can support and collaborate with each other better. We have a Community Check-In each week, where every community member can share something about their work from the past week and about their current week's goal 🎯 . You are also welcome to share fun-fact 😄 , new ideas 💡 , your learning goals ☑️. -We believe in collaborative efforts to support our community. We are running a learning platform which helps a newcomer to become master of tomorrow. 💯 +We believe in collaborative efforts to support our community. We are running a learning platform which helps a newcomer to become a leader of tomorrow. 💯 ## Title diff --git a/.travis.yml b/.travis.yml index 17d4ea24a7..01bcd714a4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -73,6 +73,6 @@ after_script: branches: only: - - master + - main - unstable - codecov diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8a15108f7b..041e07d96b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -27,6 +27,6 @@ Learn more about contributing to Public Lab code projects on these pages: If you are submitting a bug/issue , please go to https://github.com/publiclab/plots2/issues/new -Follow the [First Timers Issue Template](https://github.com/publiclab/plots2/blob/master/.github/first-timers-issue-template.md) for submitting First Timers Only issues. +Follow the [First Timers Issue Template](https://github.com/publiclab/plots2/blob/main/.github/first-timers-issue-template.md) for submitting First Timers Only issues. -Follow this standard [Issue Template](https://github.com/publiclab/plots2/blob/master/.github/ISSUE_TEMPLATE/ISSUE_TEMPLATE.md) for other issues. +Follow this standard [Issue Template](https://github.com/publiclab/plots2/blob/main/.github/ISSUE_TEMPLATE/ISSUE_TEMPLATE.md) for other issues. diff --git a/Dangerfile b/Dangerfile index 34c3ec1915..1699a6c711 100644 --- a/Dangerfile +++ b/Dangerfile @@ -2,7 +2,7 @@ if ENV['TASK'] == "rails test:system" message "@#{github.pr_author} Thank you for your pull request! I'm here to help with some tips and recommendations. Please take a look at the list provided and help us review and accept your contribution! And **don't be discouraged if you see errors** -- we're here to help." - message "Your pull request is on the `master` branch. Please [make a separate feature branch](https://publiclab.org/wiki/contributing-to-public-lab-software#A+sample+git+workflow)) with a descriptive name like `new-blog-design` while making PRs in the future." if github.branch_for_head == 'master' + message "Your pull request is on the `main` branch. Please [make a separate feature branch](https://publiclab.org/wiki/contributing-to-public-lab-software#A+sample+git+workflow)) with a descriptive name like `new-blog-design` while making PRs in the future." if github.branch_for_head == 'main' unless git.commits.any? { |c| c.message =~ /#[\d]+/ } || github.pr_body =~ /#[\d]+/ message "This pull request doesn't link to a issue number. Please refer to the issue it fixes (if any) in the body of your PR, in the format: `Fixes #123`." @@ -16,8 +16,8 @@ if ENV['TASK'] == "rails test:system" warn "New migrations added. Please update `schema.rb.example` by overwriting it with a copy of the up-to-date `db/schema.rb`. Also, be aware to preserve the MySQL-specific conditions for full-text indices." end - if git.commits.any? { |c| c.message =~ /^Merge branch 'master'/ } - warn "It looks like you merged from master in this pull request. Please [rebase](https://help.github.com/articles/about-git-rebase/) to get rid of the merge commits -- you may want to [rewind the master branch and rebase](https://publiclab.org/wiki/contributing-to-public-lab-software#Rewinding+the+master+branch) instead of merging in from master, which can cause problems when accepting new code!" + if git.commits.any? { |c| c.message =~ /^Merge branch 'main'/ } + warn "It looks like you merged from main in this pull request. Please [rebase](https://help.github.com/articles/about-git-rebase/) to get rid of the merge commits -- you may want to [rewind the main branch and rebase](https://publiclab.org/wiki/contributing-to-public-lab-software#Rewinding+the+main+branch) instead of merging in from main, which can cause problems when accepting new code!" end can_merge = github.pr_json["mergeable"] diff --git a/README.md b/README.md index e1674dc499..2468789596 100644 --- a/README.md +++ b/README.md @@ -6,11 +6,11 @@ PublicLab.org [![first-timers-only-friendly](http://img.shields.io/badge/first--timers--only-friendly-blue.svg?style=flat-square)](https://code.publiclab.org#r=all) [![Join the chat at https://publiclab.org/chat](https://img.shields.io/badge/chat-in%20different%20ways-blue.svg)](https://publiclab.org/chat) [![Code Climate](https://codeclimate.com/github/publiclab/plots2/badges/gpa.svg)](https://codeclimate.com/github/publiclab/plots2) -[![codecov](https://codecov.io/gh/publiclab/plots2/branch/master/graph/badge.svg)](https://codecov.io/gh/publiclab/plots2) +[![codecov](https://codecov.io/gh/publiclab/plots2/branch/main/graph/badge.svg)](https://codecov.io/gh/publiclab/plots2) [![View performance data on Skylight](https://badges.skylight.io/typical/GZDPChmcfm1Q.svg)](https://oss.skylight.io/app/applications/GZDPChmcfm1Q) -[![Newcomers welcome](https://img.shields.io/badge/newcomers-welcome-pink.svg)](https://code.publiclab.org) [![GitHub license](https://img.shields.io/github/license/publiclab/plots2?logo=gpl)](https://github.com/publiclab/plots2/blob/master/LICENSE) +[![Newcomers welcome](https://img.shields.io/badge/newcomers-welcome-pink.svg)](https://code.publiclab.org) [![GitHub license](https://img.shields.io/github/license/publiclab/plots2?logo=gpl)](https://github.com/publiclab/plots2/blob/main/LICENSE) -The content management system for the Public Lab research community, the `plots2` web application is a combination of a group research blog of what we call "research notes" and a wiki. Read more about the [data model here](https://github.com/publiclab/plots2/blob/master/doc/DATA_MODEL.md). +The content management system for the Public Lab research community, the `plots2` web application is a combination of a group research blog of what we call "research notes" and a wiki. Read more about the [data model here](https://github.com/publiclab/plots2/blob/main/doc/DATA_MODEL.md). It showcases a variety of features that help the Public Lab community collaborate on environmental technology design and documentation, as well as community organizing. Originally a Drupal site, it was rewritten in 2012 in Ruby on Rails and has since extended but [not yet entirely replaced](https://github.com/publiclab/plots2/issues/956) the legacy Drupal data model and database design. We ❤️ Open Source and actively participate in various OSS programs such as [Google Summer of Code(GSoC)](https://publiclab.org/wiki/gsoc), Rails Girls Summer of Code (RGSoC), Outreachy and Google Code-In (GCI). Some key features include: @@ -20,7 +20,7 @@ Some key features include: * [Wiki editing](https://publiclab.org/wiki) and revision tracking * Tagging and [topically-based groups and content organization](http://publiclab.org/tags) * Email notification subscriptions for topics and comments -* A search interface built out of [our growing API](https://github.com/publiclab/plots2/blob/master/doc/API.md) +* A search interface built out of [our growing API](https://github.com/publiclab/plots2/blob/main/doc/API.md) * A user dashboard [presenting recent activity](https://publiclab.org/dashboard) * A privacy-sensitive, Leaflet-based [location tagging system](https://github.com/publiclab/leaflet-blurred-location/) and [community map](http://publiclab.org/people) @@ -42,7 +42,7 @@ We are developing a draft Roadmap for `plots2` and our broader Public Lab code p 7. [Login](#login) 8. [Testing](#testing) 9. [Maintainers](#maintainers) -10. [API](https://github.com/publiclab/plots2/blob/master/doc/API.md) +10. [API](https://github.com/publiclab/plots2/blob/main/doc/API.md) 11. [Bundle Exec](#bundle-exec) 12. [Reply-by-email](#reply-by-email) 13. [Bugs and Support](#bugs-and-support) @@ -69,7 +69,7 @@ Our mutual aims of democratizing inexpensive and accessible do-it-yourself techn ![Diagram](https://user-images.githubusercontent.com/24359/50705765-d84ae000-1029-11e9-9e4c-f166a0c0d5d1.png) -_(Above: draft of our [Data model](https://github.com/publiclab/plots2/blob/master/doc/DATA_MODEL.md))_ +_(Above: draft of our [Data model](https://github.com/publiclab/plots2/blob/main/doc/DATA_MODEL.md))_ ## Contributing @@ -81,7 +81,7 @@ Please read and abide by our [Code of Conduct](https://publiclab.org/conduct); o ## Prerequisites -For installation, prerequisites include sqlite3 and rvm. [Click here for a complete list and instructions](https://github.com/publiclab/plots2/blob/master/doc/PREREQUISITES.md). +For installation, prerequisites include sqlite3 and rvm. [Click here for a complete list and instructions](https://github.com/publiclab/plots2/blob/main/doc/PREREQUISITES.md). ## Installation @@ -149,11 +149,11 @@ For more on the login systems, see [this page](https://github.com/publiclab/plot ## Testing -Click [here](https://github.com/publiclab/plots2/blob/master/doc/TESTING.md) for a comprehensive description of testing and [here](SYSTEM_TESTS.md) to learn about system tests. +Click [here](https://github.com/publiclab/plots2/blob/main/doc/TESTING.md) for a comprehensive description of testing and [here](SYSTEM_TESTS.md) to learn about system tests. ## Maintainers -+ See [/doc/MAINTAINERS.md](https://github.com/publiclab/plots2/blob/master/doc/MAINTAINERS.md) for Public Lab's policy on feature maintainers! ++ See [/doc/MAINTAINERS.md](https://github.com/publiclab/plots2/blob/main/doc/MAINTAINERS.md) for Public Lab's policy on feature maintainers! ## How to start and modify cron jobs @@ -176,7 +176,7 @@ Adding `bundle exec` ensures you're using the version of passenger you just inst ## Reply-by-email -Public Lab now supports reply by email to comment feature. For more details regarding it go to the [email documentation](https://github.com/publiclab/plots2/blob/master/doc/EMAIL.md) +Public Lab now supports reply by email to comment feature. For more details regarding it go to the [email documentation](https://github.com/publiclab/plots2/blob/main/doc/EMAIL.md) ## Bugs and support @@ -187,7 +187,7 @@ For additional support, join the Public Lab website and mailing list at http://p ## Recaptcha -This application uses RECAPTCHA via the recaptcha gem in production only. For more information, click [here](https://github.com/publiclab/plots2/blob/master/doc/RECAPTCHA.md). +This application uses RECAPTCHA via the recaptcha gem in production only. For more information, click [here](https://github.com/publiclab/plots2/blob/main/doc/RECAPTCHA.md). ## Internationalization @@ -195,8 +195,8 @@ Publiclab.org now supports Internationalization and localization, though we are To see it in action, click on the 'Language' drop-down located in the footer section of the page. All the guidelines and best practices for I18n can be found [here](http://guides.rubyonrails.org/i18n.html). -Translations are arranged in the YAML files [here](https://github.com/publiclab/plots2/tree/master/config/locales), which are -set in a similar way to [views](https://github.com/publiclab/plots2/tree/master/app/views) files. An example for adding translations can be found [here](http://guides.rubyonrails.org/i18n.html#adding-translations). +Translations are arranged in the YAML files [here](https://github.com/publiclab/plots2/tree/main/config/locales), which are +set in a similar way to [views](https://github.com/publiclab/plots2/tree/main/app/views) files. An example for adding translations can be found [here](http://guides.rubyonrails.org/i18n.html#adding-translations). Since the implementation of our new [Translation system](https://github.com/publiclab/plots2/issues/5737), we now use the `translation()` helper, [found here](https://github.com/publiclab/plots2/blob/438b649669b2029d01437bec9eb2826cf764851b/app/helpers/application_helper.rb#L141-L153). This provides some extra translation features such as inserting a prompt visible to site visitors if no translation exists yet. @@ -218,8 +218,8 @@ Help improve Public Lab software! * Some devs hang out in http://publiclab.org/chat (irc webchat) * Join our gitter chat at https://gitter.im/publiclab/publiclab * Try out some supportive tasks https://github.com/publiclab/plots2/wiki/Supportive-Tasks -* Get involved with our weekly community check-ins. For guidelines: [https://github.com/publiclab/plots2/tree/master/doc/CHECKINS.md -](https://github.com/publiclab/plots2/tree/master/doc/CHECKINS.md) +* Get involved with our weekly community check-ins. For guidelines: [https://github.com/publiclab/plots2/tree/main/doc/CHECKINS.md +](https://github.com/publiclab/plots2/tree/main/doc/CHECKINS.md) * You can help us by opening first timers issues or fto. The template for opening an issue can be found https://docs.google.com/document/d/1dO-CAgModEGM5cOaMmcnBh2pEON0hv_rH3P2ou2r1eE/edit ## First Time? diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 027ca45490..51070dcc7f 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -201,7 +201,7 @@ def page_not_found render file: "#{Rails.root}/public/404.html", layout: false, status: :not_found end - # TODO: make less redundant with https://github.com/publiclab/plots2/blob/master/app/helpers/application_helper.rb#L3 + # TODO: make less redundant with https://github.com/publiclab/plots2/blob/main/app/helpers/application_helper.rb#L3 def logged_in_as(roles) return false unless current_user diff --git a/doc/API.md b/doc/API.md index c60f68e546..95a37091de 100644 --- a/doc/API.md +++ b/doc/API.md @@ -128,17 +128,17 @@ All the endpoints have the optional parameter `limit` (10 by default) where you ## API code -We are beginning to consolidate API methods into the [srch](https://github.com/publiclab/plots2/blob/master/app/api/srch) namespace, to reduce complexity in the non-API codebase and make the API more predictable and maintainable. +We are beginning to consolidate API methods into the [srch](https://github.com/publiclab/plots2/blob/main/app/api/srch) namespace, to reduce complexity in the non-API codebase and make the API more predictable and maintainable. -API methods are found on the [Search class](https://github.com/publiclab/plots2/blob/master/app/api/srch/search.rb). This Search class is responsible to package the results into a [DocResult](https://github.com/publiclab/plots2/blob/master/app/models/doc_result.rb). +API methods are found on the [Search class](https://github.com/publiclab/plots2/blob/main/app/api/srch/search.rb). This Search class is responsible to package the results into a [DocResult](https://github.com/publiclab/plots2/blob/main/app/models/doc_result.rb). We also have 3 services that aim to maintain the code more easier to change/maintain: -* [ExecuteSearch](https://github.com/publiclab/plots2/blob/master/app/services/execute_search.rb): responsible to execute the requested endpoint from the params. +* [ExecuteSearch](https://github.com/publiclab/plots2/blob/main/app/services/execute_search.rb): responsible to execute the requested endpoint from the params. -* [SearchCriteria](https://github.com/publiclab/plots2/blob/master/app/services/search_criteria.rb): responsible to validate the params. +* [SearchCriteria](https://github.com/publiclab/plots2/blob/main/app/services/search_criteria.rb): responsible to validate the params. -* [SearchService](https://github.com/publiclab/plots2/blob/master/app/services/search_service.rb): responsible to perform the endpoints queries. +* [SearchService](https://github.com/publiclab/plots2/blob/main/app/services/search_service.rb): responsible to perform the endpoints queries. We also have a [Planning Issue](https://github.com/publiclab/plots2/issues/3520) if you want to contribute to the API. @@ -146,7 +146,7 @@ We also have a [Planning Issue](https://github.com/publiclab/plots2/issues/3520) This feature allows a logged user or bot to post comments via API with a token. You can generate your token to use this feature accessing your Profile on https://publiclab.org/profile/your-username (just make sure you are logged in). -This API method can be found [here](https://github.com/publiclab/plots2/blob/master/app/controllers/comment_controller.rb#L48-L73). You can see how to use this below: +This API method can be found [here](https://github.com/publiclab/plots2/blob/main/app/controllers/comment_controller.rb#L48-L73). You can see how to use this below: * **URL**: `/comment/create/token/id.:format` * **Method:** `POST` @@ -198,7 +198,7 @@ This API method can be found [here](https://github.com/publiclab/plots2/blob/mas ### RSS feeds -RSS feeds can be found [here](https://github.com/publiclab/plots2/blob/master/app/views/tag/rss.rss.builder). +RSS feeds can be found [here](https://github.com/publiclab/plots2/blob/main/app/views/tag/rss.rss.builder). * Authors: https://publiclab.org/feed/authorname.rss * Tagged notes: https://publiclab.org/feed/tag/tagname.rss @@ -217,4 +217,4 @@ To these last, you can do a wildcard tag search using the `*` character, like th * https://publiclab.org/tag/event:*.json -Several tag-based JSON/XML listings are generated [directly from controllers](https://github.com/publiclab/plots2/blob/master/app/controllers/tag_controller.rb#L97-L108), as alternate responses to various requests, ending in `.json` or `.xml`. +Several tag-based JSON/XML listings are generated [directly from controllers](https://github.com/publiclab/plots2/blob/main/app/controllers/tag_controller.rb#L97-L108), as alternate responses to various requests, ending in `.json` or `.xml`. diff --git a/doc/DATA_MODEL.md b/doc/DATA_MODEL.md index b8c394de9a..817c80a4f0 100644 --- a/doc/DATA_MODEL.md +++ b/doc/DATA_MODEL.md @@ -88,7 +88,7 @@ Answers are similar to Comments, but are used in Question-type Notes, and may ea Our primary user type is User. Users can login via email using the [Authlogic gem (a simple ruby authentication solution)](https://github.com/binarylogic/authlogic). Also, recently we have added the option to login via Twitter, Github, Facebook and Google using the -[Omniauth gem](https://github.com/publiclab/plots2/blob/master/doc/Omniauth.md). +[Omniauth gem](https://github.com/publiclab/plots2/blob/main/doc/Omniauth.md). Users each have a profile at `/profile/USERNAME`, which displays content stored in the `user.bio` text field. diff --git a/doc/EMAIL.md b/doc/EMAIL.md index 5cd89e5eeb..7d23579339 100644 --- a/doc/EMAIL.md +++ b/doc/EMAIL.md @@ -2,13 +2,13 @@ With the merge of [#2669](https://github.com/publiclab/plots2/pull/2669) Public Lab now supports Reply-by-email to comment features to the various nodes. For implementing this feature we have used `mailman` gem which is a microframework for processing incoming email. More details about this can be found at [mailman](https://github.com/mailman/mailman). -[This](https://github.com/publiclab/plots2/blob/master/script/mailman_server) file contains the script for starting the mailman server. It is using POP3 (Post Office Protocol version 3) to receive emails from a remote server to a local email client. All the configurations regarding this are to be done in [mailman script](https://github.com/publiclab/plots2/blob/master/script/mailman_server). +[This](https://github.com/publiclab/plots2/blob/main/script/mailman_server) file contains the script for starting the mailman server. It is using POP3 (Post Office Protocol version 3) to receive emails from a remote server to a local email client. All the configurations regarding this are to be done in [mailman script](https://github.com/publiclab/plots2/blob/main/script/mailman_server). After configurations are done we are good to start the `mailman` server. For starting the server run the `mailman_server` script file present inside the script folder. > ruby script/mailman_server -Above command will start the server and then the mailman server will do polling every 60 seconds(which is by default) to check for the incoming mail. However polling time can be changed by setting the value to `Mailman.config.poll_interval`(more details can be found at its' official [mailman user guide](https://github.com/mailman/mailman/blob/master/USER_GUIDE.md)). Logs for mailman can be seen in Mailman log file which is present in the `log` folder. +Above command will start the server and then the mailman server will do polling every 60 seconds(which is by default) to check for the incoming mail. However polling time can be changed by setting the value to `Mailman.config.poll_interval`(more details can be found at its' official [mailman user guide](https://github.com/mailman/mailman/blob/main/USER_GUIDE.md)). Logs for mailman can be seen in Mailman log file which is present in the `log` folder. ## Email Settings @@ -20,9 +20,9 @@ So, while notifying a user **UserTag** is checked in different files and the use | Email Settings | Default | User tag to override default (for turning OFF) | File where tag is used | | ------------- | ------------- | ----------- | ----------- | -| Notification by email for comments on your posts | ON | notify-comment-direct:false | [app/models/comment.rb](https://github.com/publiclab/plots2/blob/master/app/models/comment.rb#L135) | -| Notification by email for likes on your posts | ON |notify-likes-direct:false | [app/models/node.rb](https://github.com/publiclab/plots2/blob/master/app/models/node.rb#L906) | -| Notification by email for comments on all posts you've commented on | ON | notify-comment-indirect:false | [app/models/concerns/comments_shared.rb](https://github.com/publiclab/plots2/blob/master/app/models/concerns/comments_shared.rb#L24) | +| Notification by email for comments on your posts | ON | notify-comment-direct:false | [app/models/comment.rb](https://github.com/publiclab/plots2/blob/main/app/models/comment.rb#L135) | +| Notification by email for likes on your posts | ON |notify-likes-direct:false | [app/models/node.rb](https://github.com/publiclab/plots2/blob/main/app/models/node.rb#L906) | +| Notification by email for comments on all posts you've commented on | ON | notify-comment-indirect:false | [app/models/concerns/comments_shared.rb](https://github.com/publiclab/plots2/blob/main/app/models/concerns/comments_shared.rb#L24) | ### Digest Settings diff --git a/doc/LOGIN_SYSTEMS.md b/doc/LOGIN_SYSTEMS.md index b3dece16c7..9c6c9fcb61 100644 --- a/doc/LOGIN_SYSTEMS.md +++ b/doc/LOGIN_SYSTEMS.md @@ -18,7 +18,7 @@ Linking of any account through providers is based on the following cases: 5) If the client is not signed in and has no account with the same email address as that given by the provider through which they are trying to sign in, then a new account is created. After a new account is created, the provider is linked to that new Public Lab account and the client is notified by email to change their password. For a new account creation, `email_prefix` i.e. the part of email before `@` symbol, is used as username. In case there exists a user with the same username then randomly generated hexadecimal code is appended to the email_prefix. Then this email_prefix is used as username. -Corresponding code is present in https://github.com/publiclab/plots2/blob/master/app/models/user.rb and https://github.com/publiclab/plots2/blob/master/app/controllers/user_sessions_controller.rb. +Corresponding code is present in https://github.com/publiclab/plots2/blob/main/app/models/user.rb and https://github.com/publiclab/plots2/blob/main/app/controllers/user_sessions_controller.rb. 6) Usertags are used to store the provider and the uid for authentication. The client may delete their usertag via the profile page in order to delete the corresponding provider from their account. @@ -58,11 +58,11 @@ Or, write them in config/application.yml file ## How to set up OAuth? Add the app_id and app_secret in the Jenkins and containers/docker*.yml files in the production. -They are accessed by ENV["OAUTH_GITHUB_APP_KEY"], ENV["OAUTH_GITHUB_APP_SECRET"] etc inside the (config/initializers/omniauth.rb)[https://github.com/publiclab/plots2/blob/master/config/initializers/omniauth.rb] +They are accessed by ENV["OAUTH_GITHUB_APP_KEY"], ENV["OAUTH_GITHUB_APP_SECRET"] etc inside the (config/initializers/omniauth.rb)[https://github.com/publiclab/plots2/blob/main/config/initializers/omniauth.rb] ## How to setup login modal on various locations? -For improving UI, login and signup modals were created. The code for the login and signup modals is https://github.com/publiclab/plots2/blob/master/app/views/layouts/_header.html.erb#L176-L266. +For improving UI, login and signup modals were created. The code for the login and signup modals is https://github.com/publiclab/plots2/blob/main/app/views/layouts/_header.html.erb#L176-L266. A custom JavaScript class named 'requireLogin' is inserted at the locations where login modal needs to be rendered. @@ -85,7 +85,7 @@ See more [on this line](https://github.com/publiclab/plots2/blob/e190eae1ce7bf21 ## Testing -OAuth can be tested by including the following in [config/environments/test.rb](https://github.com/publiclab/plots2/blob/master/config/environments/test.rb) +OAuth can be tested by including the following in [config/environments/test.rb](https://github.com/publiclab/plots2/blob/main/config/environments/test.rb) ``` OmniAuth.config.test_mode = true diff --git a/doc/OPENID.md b/doc/OPENID.md index 4b20ed3fe0..ebf8c49219 100644 --- a/doc/OPENID.md +++ b/doc/OPENID.md @@ -16,7 +16,7 @@ However, MK and SWB are customized to **only** use PublicLab.org as an OpenId pr Code for the OpenId provider can be found at: -* Controller: https://github.com/publiclab/plots2/blob/master/app/controllers/openid_controller.rb +* Controller: https://github.com/publiclab/plots2/blob/main/app/controllers/openid_controller.rb * Routes: https://github.com/publiclab/plots2/blob/cac725748bbcb2a1cadf025e16f3aca5baf6a750/config/routes.rb#L58-L76 ## Testing diff --git a/doc/TESTING.md b/doc/TESTING.md index 1309e0ac83..27685e715c 100644 --- a/doc/TESTING.md +++ b/doc/TESTING.md @@ -24,7 +24,7 @@ Client-side tests (for JavaScript functions) are run using [teaspoon-mocha](http `rake teaspoon` -JavaScript tests can be found here: https://github.com/publiclab/plots2/tree/master/spec/javascripts but they're limited because they are only run against static HTML fixture files, which need to be kept up to date to match what's in the actual site HTML. +JavaScript tests can be found here: https://github.com/publiclab/plots2/tree/main/spec/javascripts but they're limited because they are only run against static HTML fixture files, which need to be kept up to date to match what's in the actual site HTML. We're also interested in exploring System Tests, which would run full-stack tests in a headless Chrome environment and allow testing of JavaScript functions on live code; see https://github.com/publiclab/plots2/issues/3683 **** @@ -64,7 +64,7 @@ Mail will be same as actual mail we will get in production. ## Testing branches -We have three principal branches: a master, where all tested new features are live, +We have three principal branches: a main, where all tested new features are live, a stable and an unstable. Those last two are used to test new code before sending them to production. If you need to use the stable or the unstable branch, @@ -74,7 +74,7 @@ already using it. ## How to run plots2 with MySQL on development and test environments In development and test environments, the project uses SQLite3, but in production -it uses [MySQL (or mariadb)](https://github.com/publiclab/plots2/blob/master/containers/docker-compose-production.yml). +it uses [MySQL (or mariadb)](https://github.com/publiclab/plots2/blob/main/containers/docker-compose-production.yml). If you need to test something that SQLite3 doesn't support, like a full-text search, for example, you need to add more steps to your configuration: @@ -148,7 +148,7 @@ file and use a skip method for the SQLite3 adapter: `skip "full text search only works on mysql/mariadb" if ActiveRecord::Base.connection.adapter_name == 'sqlite3'` -Take a look at this test [search_service_full_text_search_test.rb](https://github.com/publiclab/plots2/blob/master/test/unit/api/search_service_full_text_search_test.rb) for more details. +Take a look at this test [search_service_full_text_search_test.rb](https://github.com/publiclab/plots2/blob/main/test/unit/api/search_service_full_text_search_test.rb) for more details. This way we don't have errors either using SQLite3 or MySQL on development and tests environments. @@ -174,4 +174,4 @@ But, don't worry, feel free to ping @publiclab/maintainers on your open PR to re 3. See build progress at https://jenkins.laboratoriopublico.org/job/Plots-Unstable/. It takes 8-15 mins for build to complete. 4. Test website: https://unstable.publiclab.org/. -Once your PR is merged into plots2/master, code is only deployed to the live site [publiclab.org](publiclab.org) after some time by our maintainers. (They often send a message in our chatroom to notify contributors of this update). Fortunately, you can see your changes implemented immediately at https://stable.publiclab.org, which builds from the master branch. This is useful for testing your work again after a merge. +Once your PR is merged into plots2/main, code is only deployed to the live site [publiclab.org](publiclab.org) after some time by our maintainers. (They often send a message in our chatroom to notify contributors of this update). Fortunately, you can see your changes implemented immediately at https://stable.publiclab.org, which builds from the main branch. This is useful for testing your work again after a merge. diff --git a/doc/reply_by_tweet.md b/doc/reply_by_tweet.md index fcba074cda..cf64c1f6c3 100644 --- a/doc/reply_by_tweet.md +++ b/doc/reply_by_tweet.md @@ -4,9 +4,9 @@ ### Steps: -- Cron job for polling for getting new tweets to `publiclab` is defined in [config/schedule.rb](https://github.com/publiclab/plots2/blob/master/config/schedule.rb "config/schedule.rb") using whenever gem which will call `receive_tweet` function of [models/comment.rb](https://github.com/publiclab/plots2/blob/master/app/models/comment.rb "models/comment.rb") in the interval of one minute. +- Cron job for polling for getting new tweets to `publiclab` is defined in [config/schedule.rb](https://github.com/publiclab/plots2/blob/main/config/schedule.rb "config/schedule.rb") using whenever gem which will call `receive_tweet` function of [models/comment.rb](https://github.com/publiclab/plots2/blob/main/app/models/comment.rb "models/comment.rb") in the interval of one minute. -- `receive_tweet` method of [models/comment.rb](https://github.com/publiclab/plots2/blob/master/app/models/comment.rb "models/comment.rb") will look for if there is any comment already present that contains tweet_id if it does it will call `receive_tweet_using_since` otherwise it will call `receive_tweet_without_using_since `. +- `receive_tweet` method of [models/comment.rb](https://github.com/publiclab/plots2/blob/main/app/models/comment.rb "models/comment.rb") will look for if there is any comment already present that contains tweet_id if it does it will call `receive_tweet_using_since` otherwise it will call `receive_tweet_without_using_since `. - `receive_tweet_using_since` will search for the tweets to the `publiclab` which are tweeted after that tweet with the `tweet_id` present in the database.