Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • A administrate
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 96
    • Issues 96
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 32
    • Merge requests 32
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • thoughtbot, inc.
  • administrate
  • Merge requests
  • !1551

More readable warnings

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Pablo Brasero requested to merge github/fork/pablobm/better-generator-warnings into master Feb 13, 2020
  • Overview 5
  • Commits 1
  • Pipelines 0
  • Changes 2

During normal operation, the routes generator can print a few warnings. When there's more than one reason to trigger a warning for a given resource, these are printed out separately, often with other warnings intereleaved.

For example, these are 8 warning about 4 different resources:

WARNING: Unable to generate a dashboard for ActionText::RichText.
         Administrate does not yet support namespaced models.
WARNING: Unable to generate a dashboard for ActionMailbox::InboundEmail.
         Administrate does not yet support namespaced models.
WARNING: Unable to generate a dashboard for ActiveStorage::Blob.
         Administrate does not yet support namespaced models.
WARNING: Unable to generate a dashboard for ActiveStorage::Attachment.
         Administrate does not yet support namespaced models.
WARNING: Unable to generate a dashboard for ActionText::RichText.
         It is not connected to a database table.
         Make sure your database migrations are up to date.
WARNING: Unable to generate a dashboard for ActionMailbox::InboundEmail.
         It is not connected to a database table.
         Make sure your database migrations are up to date.
WARNING: Unable to generate a dashboard for ActiveStorage::Blob.
         It is not connected to a database table.
         Make sure your database migrations are up to date.
WARNING: Unable to generate a dashboard for ActiveStorage::Attachment.
         It is not connected to a database table.
         Make sure your database migrations are up to date.

This is a bit difficult to read and can be confusing. Instead, I propose that we group together the warnings related to each given resource, like so:

WARNING: Unable to generate a dashboard for ActionText::RichText.
       - Administrate does not yet support namespaced models.
       - It is not connected to a database table.
         Make sure your database migrations are up to date.
WARNING: Unable to generate a dashboard for ActionMailbox::InboundEmail.
       - Administrate does not yet support namespaced models.
       - It is not connected to a database table.
         Make sure your database migrations are up to date.
WARNING: Unable to generate a dashboard for ActiveStorage::Blob.
       - Administrate does not yet support namespaced models.
       - It is not connected to a database table.
         Make sure your database migrations are up to date.
WARNING: Unable to generate a dashboard for ActiveStorage::Attachment.
       - Administrate does not yet support namespaced models.
       - It is not connected to a database table.
         Make sure your database migrations are up to date.

This PR implements this behaviour.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/pablobm/better-generator-warnings