Skip to content

trouble with annotate after upgrading from 2.7.5 to 3.0.2 #663

Open
@gingerlime

Description

@gingerlime

I'm trying to upgrade from 2.7.5 to 3.0.2 but somehow it looks like annotate fails silently and doesn't work any more...

A couple of things:

  • our CI pipeline runs bundle exec annotate to make sure no model annotations are missing. This now fails. Perhaps annotate no longer outputs "Model files unchanged" when there are no changes? I'm not sure
  • I tried to create a simple migration to a table and running rake db:migrate, but it doesn't automatically add annotations (no errors, I did add the rake task using rails g annotate:install).
  • also manually running bundle exec annotate after the migration was run (I can see schema.rb updated), doesn't update the annotations... It just doesn't seem to do anything... No errors or exit code other than 0 either.

Commands

$ git st
On branch dependabot/bundler/annotate-3.0.2
Your branch is up to date with 'origin/dependabot/bundler/annotate-3.0.2'.

Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

        new file:   db/migrate/20190930085602_blablabla.rb
        new file:   lib/tasks/auto_annotate_models.rake

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

        modified:   db/schema.rb

$ git diff db/schema.rb
diff --git a/db/schema.rb b/db/schema.rb
index 4ddfcf5e8..3d1173ce6 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -10,7 +10,7 @@
 #
 # It's strongly recommended that you check this file into your version control system.

-ActiveRecord::Schema.define(version: 2019_08_22_094809) do
+ActiveRecord::Schema.define(version: 2019_09_30_085602) do

   # These are extensions that must be enabled in order to support this database
   enable_extension "hstore"
@@ -469,6 +469,7 @@ ActiveRecord::Schema.define(version: 2019_08_22_094809) do
     t.string "active_session_id"
+    t.boolean "xyz"

...

$ bundle exec annotate
warning: parser/current is loading parser/ruby25, which recognizes
warning: 2.5.6-compliant syntax, but you are running 2.5.3.
warning: please see https://github.com/whitequark/parser#compatibility-with-ruby-mri.
2019-09-30 09:07:40.448472 DEBUG name=Sidekiq message=Sidekiq client with redis options {:url=>"redis://redis:6379", :reconnect_attempts=>10, :reconnect_delay=>0.3, :reconnect_delay_max=>9, :id=>"Sidekiq-client-PID-1211"} payload=null tags= named_tags= duration= process_info=1211:47101335709180 exception=

Version

  • annotate version (3.0.2)
  • rails version (5.2)
  • ruby version (2.5.3)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions