Skip to content
Snippets Groups Projects

merge_request: add work_in_progress to MR hooks

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • !(current_expr).nil?

  • I think the model should change from:

      def work_in_progress?
        title =~ /\A\[?WIP\]?:? /i
      end

    To something like:

      def work_in_progress?
        (title =~ /\A\[?WIP\]?:? /i) ? true : false
      end

    or

      def work_in_progress?
        !!(title =~ /\A\[?WIP\]?:? /i)
      end
    Edited by Stan Hu
  • I think I've seen the !! pattern elsewhere. Not sure about the ?: one. Would that belong on a separate branch? If so, before or after this one lands?

  • Given all the other callers interpret the return value as true or false, I think it's fine to fold the change into this MR and have specs for this. You're welcome to open a new MR for that, though.

  • Added 28 commits:

    • f9e2c0e3...54452412 - 26 commits from branch gitlab-org:master
    • cf0315d7 - merge_request: coerce work_in_progress? into a boolean
    • edba67d9 - merge_request: add work_in_progress to MR hooks
  • Updated.

  • Thanks. I'm confused why the diff is showing changes in the CHANGELOG that are already present in master:

    image

  • Added 1 commit:

    • c84a2ea8 - merge_request: add work_in_progress to MR hooks
  • That is…interesting. I would have expected git to conflict on something like that, not make a diff from thin air. Anyways, rebased again to remove the unnecessary diffs.

  • Thanks. Can you add a spec for #to_hook_attrs in merge_requests_spec.rb?

  • Added 1 commit:

    • 8b4acad4 - merge_request: add work_in_progress to MR hooks
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading