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

fix for wiki update #4942

Merged
merged 1 commit into from
Mar 7, 2019
Merged

fix for wiki update #4942

merged 1 commit into from
Mar 7, 2019

Conversation

grvsachdeva
Copy link
Member

Fixes #4941 (<=== Add issue number here)

Make sure these boxes are checked before your pull request (PR) is ready to be reviewed and merged. Thanks!

  • tests pass -- look for a green checkbox ✔️ a few minutes after opening your PR -- or run tests locally with rake test
  • code is in uniquely-named feature branch and has no merge conflicts 📁
  • PR is descriptively titled 📑
  • screenshots/GIFs are attached 📎 in case of UI updation
  • ask @publiclab/reviewers for help, in a comment below

We're happy to help you get this ready -- don't be afraid to ask for help, and don't be discouraged if your tests fail at first!

If tests do fail, click on the red X to learn why by reading the logs.

Please be sure you've reviewed our contribution guidelines at https://publiclab.org/contributing-to-public-lab-software

Thanks!

wiki_working

@siaw23-retired
Copy link
Collaborator

siaw23-retired commented Mar 7, 2019

Maybe a test for this so it never happens in the future would be great!

@grvsachdeva
Copy link
Member Author

I just checked tests are already there for update https://github.com/publiclab/plots2/blob/master/test/functional/wiki_controller_test.rb#L141-L149 and some more in the same file.

I ran the tests on master branch and got these errors, due to null assignment to node.vid

sachdevarockz@sachdevarockz-Latitude-E6430:~/Desktop/open source/Publiclab/plots2$ ruby -I test test/functional/wiki_controller_test.rb
[Coveralls] Set up the SimpleCov formatter.
[Coveralls] Using SimpleCov's default settings.
DEPRECATION WARNING: Leaving `ActiveRecord::ConnectionAdapters::SQLite3Adapter.represent_boolean_as_integer`
set to false is deprecated. SQLite databases have used 't' and 'f' to serialize
boolean values and must have old data converted to 1 and 0 (its native boolean
serialization) before setting this flag to true. Conversion can be accomplished
by setting up a rake task which runs

  ExampleModel.where("boolean_column = 't'").update_all(boolean_column: 1)
  ExampleModel.where("boolean_column = 'f'").update_all(boolean_column: 0)

for all models and all boolean columns, after which the flag must be set to
true by adding the following to your application.rb file:

  Rails.application.config.active_record.sqlite3.represent_boolean_as_integer = true
 (called from <top (required)> at /home/sachdevarockz/Desktop/open source/Publiclab/plots2/config/environment.rb:5)
Emptying /home/sachdevarockz/Desktop/open source/Publiclab/plots2/test/reports
DEPRECATION WARNING: This Authlogic configuration option (validates_format_of_email_field_options) is deprecated. Use normal
ActiveRecord validation instead. Detailed instructions:
https://github.com/binarylogic/authlogic/blob/master/doc/use_normal_rails_validation.md
 (called from block in <class:User> at /home/sachdevarockz/Desktop/open source/Publiclab/plots2/app/models/user.rb:26)
You have selected Sha512 as your authlogic crypto provider. This algorithm
does not have any practical known attacks against it. However, there are
better choices.

Authlogic has no plans yet to deprecate this crypto provider. However,
we recommend transitioning to a more secure, adaptive hashing algorithm,
like scrypt. Adaptive algorithms are designed to slow down brute force
attacks, and over time the iteration count can be increased to make it
slower, so it remains resistant to brute-force search attacks even in
the face of increasing computation power.

Use the transition_from_crypto_providers option to make the transition
painless for your users.
Started with run options --seed 7364

/home/sachdevarockz/.rvm/gems/ruby-2.4.4/gems/activerecord-5.2.2/lib/active_record/associations/builder/collection_association.rb:27: warning: already initialized constant TagNodeAssociationExtension
/home/sachdevarockz/.rvm/gems/ruby-2.4.4/gems/activerecord-5.2.2/lib/active_record/associations/builder/collection_association.rb:27: warning: previous definition of TagNodeAssociationExtension was here
ERROR["test_should_choose_I18n_for_wiki_controller", #<Minitest::Reporters::Suite:0x000055d529cb1278 @name="WikiControllerTest">, 2.6951628170063486]
 test_should_choose_I18n_for_wiki_controller#WikiControllerTest (2.70s)
ActiveRecord::NotNullViolation:         ActiveRecord::NotNullViolation: SQLite3::ConstraintException: NOT NULL constraint failed: node.vid: UPDATE "node" SET "vid" = ?, "title" = ?, "changed" = ? WHERE "node"."nid" = ?
            app/controllers/wiki_controller.rb:467:in `block in update_node_attributes'
            app/controllers/wiki_controller.rb:452:in `update_node_attributes'
            app/controllers/wiki_controller.rb:197:in `update'
            test/functional/wiki_controller_test.rb:426:in `block (2 levels) in <class:WikiControllerTest>'
            test/functional/wiki_controller_test.rb:415:in `each'
            test/functional/wiki_controller_test.rb:415:in `block in <class:WikiControllerTest>'

ERROR["test_update_root-path_(/about)_wiki", #<Minitest::Reporters::Suite:0x000055d529531700 @name="WikiControllerTest">, 4.606402018995141]
 test_update_root-path_(/about)_wiki#WikiControllerTest (4.61s)
ActiveRecord::NotNullViolation:         ActiveRecord::NotNullViolation: SQLite3::ConstraintException: NOT NULL constraint failed: node.vid: UPDATE "node" SET "vid" = ?, "title" = ?, "changed" = ? WHERE "node"."nid" = ?
            app/controllers/wiki_controller.rb:467:in `block in update_node_attributes'
            app/controllers/wiki_controller.rb:452:in `update_node_attributes'
            app/controllers/wiki_controller.rb:197:in `update'
            test/functional/wiki_controller_test.rb:195:in `block in <class:WikiControllerTest>'

ERROR["test_update_wiki_selecting_previous_image", #<Minitest::Reporters::Suite:0x000055d5293f5eb8 @name="WikiControllerTest">, 4.630522109000594]
 test_update_wiki_selecting_previous_image#WikiControllerTest (4.63s)
ActiveRecord::NotNullViolation:         ActiveRecord::NotNullViolation: SQLite3::ConstraintException: NOT NULL constraint failed: node.vid: UPDATE "node" SET "vid" = ?, "title" = ?, "changed" = ? WHERE "node"."nid" = ?
            app/controllers/wiki_controller.rb:467:in `block in update_node_attributes'
            app/controllers/wiki_controller.rb:452:in `update_node_attributes'
            app/controllers/wiki_controller.rb:197:in `update'
            test/functional/wiki_controller_test.rb:217:in `block in <class:WikiControllerTest>'

ERROR["test_update_wiki_uploading_new_image", #<Minitest::Reporters::Suite:0x000055d529347638 @name="WikiControllerTest">, 4.664758540995535]
 test_update_wiki_uploading_new_image#WikiControllerTest (4.66s)
ActiveRecord::NotNullViolation:         ActiveRecord::NotNullViolation: SQLite3::ConstraintException: NOT NULL constraint failed: node.vid: UPDATE "node" SET "vid" = ?, "title" = ?, "changed" = ? WHERE "node"."nid" = ?
            app/controllers/wiki_controller.rb:467:in `block in update_node_attributes'
            app/controllers/wiki_controller.rb:452:in `update_node_attributes'
            app/controllers/wiki_controller.rb:197:in `update'
            test/functional/wiki_controller_test.rb:206:in `block in <class:WikiControllerTest>'

ERROR["test_updating_wiki", #<Minitest::Reporters::Suite:0x000055d5292cd2c0 @name="WikiControllerTest">, 4.687289276000229]
 test_updating_wiki#WikiControllerTest (4.69s)
ActiveRecord::NotNullViolation:         ActiveRecord::NotNullViolation: SQLite3::ConstraintException: NOT NULL constraint failed: node.vid: UPDATE "node" SET "vid" = ?, "title" = ?, "changed" = ? WHERE "node"."nid" = ?
            app/controllers/wiki_controller.rb:467:in `block in update_node_attributes'
            app/controllers/wiki_controller.rb:452:in `update_node_attributes'
            app/controllers/wiki_controller.rb:197:in `update'
            test/functional/wiki_controller_test.rb:145:in `block in <class:WikiControllerTest>'

  54/54: [=================================] 100% Time: 00:00:04, Time: 00:00:04

Finished in 4.82390s
54 tests, 138 assertions, 0 failures, 5 errors, 0 skips
Writing XML reports to /home/sachdevarockz/Desktop/open source/Publiclab/plots2/test/reports
sachdevarockz@sachdevarockz-Latitude-E6430:~/Desktop/open source/Publiclab/plots2$ 

@plotsbot
Copy link
Collaborator

plotsbot commented Mar 7, 2019

1 Message
📖 @gauravano 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.

Generated by 🚫 Danger

@siaw23-retired
Copy link
Collaborator

Hmmm... this is weird. There's a test for update yet CI passed? Interesting.

@jywarren
Copy link
Member

jywarren commented Mar 7, 2019

I'm merging this and publishing, thank you very much. Yeah it is a mystery to me, i wonder how CI passed in Travis? Gaurav, are you saying that locally it didn't pass but in Travis it did?

@jywarren jywarren merged commit 5469e0d into publiclab:master Mar 7, 2019
@grvsachdeva
Copy link
Member Author

Gaurav, are you saying that locally it didn't pass but in Travis it did?

@jywarren yes!

As you can see this bug got in through #4902 when revision.save was placed after update_node_attributes - 40b6624#diff-528416b5954756daa0b141666006dbcbR197. tests should've failed at that point but they didn't and that's why we didn't come to know about this bug there.

But, in local tests failed when I ran tests on wiki_controller_test.rb .

jywarren pushed a commit that referenced this pull request Mar 9, 2019
* Added debounce for typeahead search optimization

* Update README.md (#4883)

The "What makes this project different" section had several long sentences which were difficult to understand. I tried to fix this by breaking the sentences down into smaller more concise sentences.

* convert chars to unicode (#4901)

* fixes for map module (#4909)

* fixes for map module

* yarn.lock update

* updated yarn.lock (#4911)

* updated yarn.lock

* tweak

* Remove useless variable assignment (#4885)

* Simplify username generation

* Use status module

* Tiny fix

* Fix indentation

* Made moderate buttons to appear on the same line (#4913)

* Made moderate buttons to appear on the same line

* Removed break tag.

* Clean up (#4902)

* Clean up with Rubocop

* More cleanup

* Excluse views

* Small refactor

* More clean up

* Clean up

* Fix conflict

* Tiny fix

* Follow tag asynchronously (#4587)

* Follow tag asynchronously


Added link to manage subscriptions


Add precondition failed http error code


cleanup


codeclimate fix


Fix typo change


remove data-remote


Preserve code for non xhr requests


Seperate JS and html


Codeclimate fix


Code Climate fixes


Updated tests

* Remove pre-compilation of async.js

* pre compilation of js assets

* cc fix try

* Move verification link (#4786)

* Move verification link

* Change link to text

* Remove unnecessary message

* popover works, styling is still not showing under elements but is und… (#4906)

* popover works, styling is still not showing under elements but is under.btn-default

* copied yml file back in

* First timer tag script (#4878)

* First timer tag script

* migration for attaching first-time-poster

* change migration bump version to 5.1

* Update schema.rb.example

* Consolidating ranges and stats (#4887)

* restyle range page to be a partial

* remove static stats

* merge range and main stats

* render range in main stats

* fix failing range test

* add questions vs answers graph

* add go back and further buttons

* minor fixes

* Change contribution graph making method

Change method to create graph based on the range given

* fix failing test and code climate issues

* remove commented code and indent

* remove stats_nav partial

* add contribution graph tests

* review requests implemetation

* move tag graph button (#4921)

* move tag graph button

* Update _user_controls.html.erb

* Added reply by tweet feature (#3175)

* Added reply by tweet feature

* Updated schedule.rb file

* Finalized reply-by-tweet

* Corrected schema version

* Minor change

* Added reply_by_tweet doc

* Minor changes

* Added twitter gem

* Minor changes

* Added Environment variables in Docker

* Added summery in Doc file

* Corrected schema version

* Added some documentation

* Added some documentation

* Migration timestamp changed

* Changed migration

* Minor change

* Minor changes

* Added rake to general gem list

* Added bundle exec for rake/rails tasks in schedule.rb

* Added path env variable

* MINOR CHANGE

* MINOR CHANGE

* MINOR CHANGE

* MINOR CHANGE

* Added print statement to check print

* Minor change

* Minor change

* Changed whenever config

* Minor change

* Completed reply by tweet feature

* Minor change

* Minor change

* Added gemfile.lock

* Update comment.rb

* Added gemfile.lock

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Add more relevant search results (#4848)

* add helper functions

* Modify controller to take extra results

* add dict file

* add  more objects

* refactor code and add tests

* cc fix

* change numbers to account for additions in fixtures

* fix tests

* remove unused include

* code quality fixes

* tab fix

* changing implementation ideas, removal of unnecessary code

* newline fix

* cc fix

* cc space inside brackets fix

* modify query to get rid of redundant words

* reduce word to root then tranform

* Change file name

* chore: update README.md (#4926)

Fixes task mentioned in issue #4749

* Bump cytoscape from 3.4.2 to 3.5.0 (#4929)

Bumps [cytoscape](https://github.com/cytoscape/cytoscape.js) from 3.4.2 to 3.5.0.
- [Release notes](https://github.com/cytoscape/cytoscape.js/releases)
- [Commits](cytoscape/cytoscape.js@v3.4.2...v3.5.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>

* Tiny fix (#4933)

* Tiny fix

* Rubocop

* Update 20190301075323_add_first_tag_poster.rb

* updates (#4851)

* fix for wiki update (#4942)

* fixes, extend to title suggestions

* extended to atwho
icarito pushed a commit to icarito/plots2 that referenced this pull request Apr 9, 2019
icarito pushed a commit to icarito/plots2 that referenced this pull request Apr 9, 2019
* Added debounce for typeahead search optimization

* Update README.md (publiclab#4883)

The "What makes this project different" section had several long sentences which were difficult to understand. I tried to fix this by breaking the sentences down into smaller more concise sentences.

* convert chars to unicode (publiclab#4901)

* fixes for map module (publiclab#4909)

* fixes for map module

* yarn.lock update

* updated yarn.lock (publiclab#4911)

* updated yarn.lock

* tweak

* Remove useless variable assignment (publiclab#4885)

* Simplify username generation

* Use status module

* Tiny fix

* Fix indentation

* Made moderate buttons to appear on the same line (publiclab#4913)

* Made moderate buttons to appear on the same line

* Removed break tag.

* Clean up (publiclab#4902)

* Clean up with Rubocop

* More cleanup

* Excluse views

* Small refactor

* More clean up

* Clean up

* Fix conflict

* Tiny fix

* Follow tag asynchronously (publiclab#4587)

* Follow tag asynchronously


Added link to manage subscriptions


Add precondition failed http error code


cleanup


codeclimate fix


Fix typo change


remove data-remote


Preserve code for non xhr requests


Seperate JS and html


Codeclimate fix


Code Climate fixes


Updated tests

* Remove pre-compilation of async.js

* pre compilation of js assets

* cc fix try

* Move verification link (publiclab#4786)

* Move verification link

* Change link to text

* Remove unnecessary message

* popover works, styling is still not showing under elements but is und… (publiclab#4906)

* popover works, styling is still not showing under elements but is under.btn-default

* copied yml file back in

* First timer tag script (publiclab#4878)

* First timer tag script

* migration for attaching first-time-poster

* change migration bump version to 5.1

* Update schema.rb.example

* Consolidating ranges and stats (publiclab#4887)

* restyle range page to be a partial

* remove static stats

* merge range and main stats

* render range in main stats

* fix failing range test

* add questions vs answers graph

* add go back and further buttons

* minor fixes

* Change contribution graph making method

Change method to create graph based on the range given

* fix failing test and code climate issues

* remove commented code and indent

* remove stats_nav partial

* add contribution graph tests

* review requests implemetation

* move tag graph button (publiclab#4921)

* move tag graph button

* Update _user_controls.html.erb

* Added reply by tweet feature (publiclab#3175)

* Added reply by tweet feature

* Updated schedule.rb file

* Finalized reply-by-tweet

* Corrected schema version

* Minor change

* Added reply_by_tweet doc

* Minor changes

* Added twitter gem

* Minor changes

* Added Environment variables in Docker

* Added summery in Doc file

* Corrected schema version

* Added some documentation

* Added some documentation

* Migration timestamp changed

* Changed migration

* Minor change

* Minor changes

* Added rake to general gem list

* Added bundle exec for rake/rails tasks in schedule.rb

* Added path env variable

* MINOR CHANGE

* MINOR CHANGE

* MINOR CHANGE

* MINOR CHANGE

* Added print statement to check print

* Minor change

* Minor change

* Changed whenever config

* Minor change

* Completed reply by tweet feature

* Minor change

* Minor change

* Added gemfile.lock

* Update comment.rb

* Added gemfile.lock

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Add more relevant search results (publiclab#4848)

* add helper functions

* Modify controller to take extra results

* add dict file

* add  more objects

* refactor code and add tests

* cc fix

* change numbers to account for additions in fixtures

* fix tests

* remove unused include

* code quality fixes

* tab fix

* changing implementation ideas, removal of unnecessary code

* newline fix

* cc fix

* cc space inside brackets fix

* modify query to get rid of redundant words

* reduce word to root then tranform

* Change file name

* chore: update README.md (publiclab#4926)

Fixes task mentioned in issue publiclab#4749

* Bump cytoscape from 3.4.2 to 3.5.0 (publiclab#4929)

Bumps [cytoscape](https://github.com/cytoscape/cytoscape.js) from 3.4.2 to 3.5.0.
- [Release notes](https://github.com/cytoscape/cytoscape.js/releases)
- [Commits](cytoscape/cytoscape.js@v3.4.2...v3.5.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>

* Tiny fix (publiclab#4933)

* Tiny fix

* Rubocop

* Update 20190301075323_add_first_tag_poster.rb

* updates (publiclab#4851)

* fix for wiki update (publiclab#4942)

* fixes, extend to title suggestions

* extended to atwho
SrinandanPai pushed a commit to SrinandanPai/plots2 that referenced this pull request May 5, 2019
SrinandanPai pushed a commit to SrinandanPai/plots2 that referenced this pull request May 5, 2019
* Added debounce for typeahead search optimization

* Update README.md (publiclab#4883)

The "What makes this project different" section had several long sentences which were difficult to understand. I tried to fix this by breaking the sentences down into smaller more concise sentences.

* convert chars to unicode (publiclab#4901)

* fixes for map module (publiclab#4909)

* fixes for map module

* yarn.lock update

* updated yarn.lock (publiclab#4911)

* updated yarn.lock

* tweak

* Remove useless variable assignment (publiclab#4885)

* Simplify username generation

* Use status module

* Tiny fix

* Fix indentation

* Made moderate buttons to appear on the same line (publiclab#4913)

* Made moderate buttons to appear on the same line

* Removed break tag.

* Clean up (publiclab#4902)

* Clean up with Rubocop

* More cleanup

* Excluse views

* Small refactor

* More clean up

* Clean up

* Fix conflict

* Tiny fix

* Follow tag asynchronously (publiclab#4587)

* Follow tag asynchronously


Added link to manage subscriptions


Add precondition failed http error code


cleanup


codeclimate fix


Fix typo change


remove data-remote


Preserve code for non xhr requests


Seperate JS and html


Codeclimate fix


Code Climate fixes


Updated tests

* Remove pre-compilation of async.js

* pre compilation of js assets

* cc fix try

* Move verification link (publiclab#4786)

* Move verification link

* Change link to text

* Remove unnecessary message

* popover works, styling is still not showing under elements but is und… (publiclab#4906)

* popover works, styling is still not showing under elements but is under.btn-default

* copied yml file back in

* First timer tag script (publiclab#4878)

* First timer tag script

* migration for attaching first-time-poster

* change migration bump version to 5.1

* Update schema.rb.example

* Consolidating ranges and stats (publiclab#4887)

* restyle range page to be a partial

* remove static stats

* merge range and main stats

* render range in main stats

* fix failing range test

* add questions vs answers graph

* add go back and further buttons

* minor fixes

* Change contribution graph making method

Change method to create graph based on the range given

* fix failing test and code climate issues

* remove commented code and indent

* remove stats_nav partial

* add contribution graph tests

* review requests implemetation

* move tag graph button (publiclab#4921)

* move tag graph button

* Update _user_controls.html.erb

* Added reply by tweet feature (publiclab#3175)

* Added reply by tweet feature

* Updated schedule.rb file

* Finalized reply-by-tweet

* Corrected schema version

* Minor change

* Added reply_by_tweet doc

* Minor changes

* Added twitter gem

* Minor changes

* Added Environment variables in Docker

* Added summery in Doc file

* Corrected schema version

* Added some documentation

* Added some documentation

* Migration timestamp changed

* Changed migration

* Minor change

* Minor changes

* Added rake to general gem list

* Added bundle exec for rake/rails tasks in schedule.rb

* Added path env variable

* MINOR CHANGE

* MINOR CHANGE

* MINOR CHANGE

* MINOR CHANGE

* Added print statement to check print

* Minor change

* Minor change

* Changed whenever config

* Minor change

* Completed reply by tweet feature

* Minor change

* Minor change

* Added gemfile.lock

* Update comment.rb

* Added gemfile.lock

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Add more relevant search results (publiclab#4848)

* add helper functions

* Modify controller to take extra results

* add dict file

* add  more objects

* refactor code and add tests

* cc fix

* change numbers to account for additions in fixtures

* fix tests

* remove unused include

* code quality fixes

* tab fix

* changing implementation ideas, removal of unnecessary code

* newline fix

* cc fix

* cc space inside brackets fix

* modify query to get rid of redundant words

* reduce word to root then tranform

* Change file name

* chore: update README.md (publiclab#4926)

Fixes task mentioned in issue publiclab#4749

* Bump cytoscape from 3.4.2 to 3.5.0 (publiclab#4929)

Bumps [cytoscape](https://github.com/cytoscape/cytoscape.js) from 3.4.2 to 3.5.0.
- [Release notes](https://github.com/cytoscape/cytoscape.js/releases)
- [Commits](cytoscape/cytoscape.js@v3.4.2...v3.5.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>

* Tiny fix (publiclab#4933)

* Tiny fix

* Rubocop

* Update 20190301075323_add_first_tag_poster.rb

* updates (publiclab#4851)

* fix for wiki update (publiclab#4942)

* fixes, extend to title suggestions

* extended to atwho
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.

4 participants