Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • pleroma pleroma
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 646
    • Issues 646
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 89
    • Merge requests 89
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • PleromaPleroma
  • pleromapleroma
  • Merge requests
  • !3451

Recompilation speedup: Put custom guards in Web.Utils.Guards

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Alex Gleason requested to merge cycles-guard into develop Jun 07, 2021
  • Overview 0
  • Commits 1
  • Pipelines 1
  • Changes 3

User.Query uses a custom guard, not_empty_string/1, which checks that a param is_binary() and isn't "".

For some reason that guard was inside AdminAPI.Search, creating compile-time cycles. not_empty_string/1 is generic and reusable, so I moved it to a new module for holding site-wide guards, Web.Utils.Guards.

Doing so gets rid of a cycle: https://www.diffchecker.com/8xepzWZE

Screenshot_from_2021-06-07_15-53-25

Also, I rewrote not_empty_string/1 using defguard (Elixir 1.6) instead of defmacro.

Edited Jun 07, 2021 by Alex Gleason
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: cycles-guard