#4648 Fix rebase behaviour
Merged by pingou. Opened by jlanda.
jlanda/pagure rebase-tests  into  master

Download 4648.patch

1 new commit added

  • pagure/templates/repo_pull_request: remove double identical jinga2 {%if } block

2 new commits added

  • templates/repo_pull_request.html: simplify jinga2 conditionals
  • small modifications to pull request rebase button showing logic:

2 new commits added

  • templates/repo_pull_request.html: simplify jinja2 conditionals
  • small modifications to pull request rebase button showing logic:

rebased onto 6bec4c1b46929b98762a3c142553640083a774b9

6bec4c1 : actually I'm not sure if this is correct, can a user rebase a branch on a instance that does not allow removing them? tbh, no idea :)

35e711e: Current templating code is quite unreadable due to nested ifs that duplicate conditionals: https://pagure.io/pagure/blob/master/f/pagure/templates/repo_pull_request.html#_138-141 so this reworks that part of the template to be clean and readable. Any html output change is unintentional except the removing of an <small> block inside an impossible {% else %} block

1 new commit added

  • pagure/api/fork.py: allow rebasing with non project tokens

b838981: right now rebase api endpoint is limited to project tokens, but on frontend we have an actor (those who are not upstream repo committers but have enough perms to rebase the fork) that can not have a project specific token for the upstream repo, so allow everyone to use global tokens to rebase

pretty please pagure-ci rebuild

rebased onto af38c8135daf163c395635c9a9bdb37812b63c5e

1 new commit added

  • api/fork: fix authorization conditionals

1 new commit added

  • tests/tests_pagure_flask_rebase: rename and fix test suite to align

After talking with @pingou we think that when allow_rebase is set to false, those who have enough rights to rebase branches on pull request's origin project should be allowed to rebase from ui since they can do it via git. 84ce6f1 fixes this.

With this modified scenario, our current allow_rebase = false test scenario is allowed to rebase since the test users are also committers on pull_request.project_from . efd15b7 modifies this.

Now we just need tests for the denied cases :)

5 new commits added

  • tests/tests_pagure_flask_rebase: rename and fix test suite to align
  • api/fork: fix authorization conditionals
  • pagure/api/fork.py: allow rebasing with non project tokens
  • templates/repo_pull_request.html: simplify jinja2 conditionals
  • small modifications to pull request rebase button showing logic:

1 new commit added

  • templates/repo_pull_request.html UX: add a disabled button to committers when

I think I finished the refactoring|fixing process here. Any thoughts? I'll continue with tests asap

1 new commit added

  • tests/test_pagure_flask_rebase: leverage test suit to use a fork

7 new commits added

  • tests/test_pagure_flask_rebase: leverage test suit to use a fork when allow_rebase = True
  • templates/repo_pull_request.html UX: add a disabled button to committers when
  • tests/tests_pagure_flask_rebase: rename and fix test suite to align
  • api/fork: fix authorization conditionals
  • pagure/api/fork.py: allow rebasing with non project tokens
  • templates/repo_pull_request.html: simplify jinja2 conditionals
  • small modifications to pull request rebase button showing logic:

This change raised a different rebase bug :S

Now the allow_rebase = True test case is using a fork repo instead of pull requesting from one branch to other on the same repo.

This allows us to test the case where the pull_request author can rebase the pull request without being committer on the destination repo.

We need to leverage the allow_rebase = False case on the same way so we can test all the rebase button use cases

7 new commits added

  • tests/test_pagure_flask_rebase: leverage test suit to use a fork when allow_rebase = True
  • templates/repo_pull_request.html UX: add a disabled button to committers when
  • tests/tests_pagure_flask_rebase: rename and fix test suite to align
  • api/fork: fix authorization conditionals
  • pagure/api/fork.py: allow rebasing with non project tokens
  • templates/repo_pull_request.html: simplify jinja2 conditionals
  • small modifications to pull request rebase button showing logic:

6 new commits added

  • tests/tests_pagure_flask_rebase: align to code and add more test cases
  • templates/repo_pull_request.html UX: add a disabled button to committers when
  • api/fork: fix authorization conditionals
  • pagure/api/fork.py: allow rebasing with non project tokens
  • templates/repo_pull_request.html: simplify jinja2 conditionals
  • small modifications to pull request rebase button showing logic:

This is ready for review

pretty please pagure-ci rebuild

Broken pipeline

pretty please pagure-ci rebuild

psutil and pip-30 container thing seems fixed, let rerun the pipeline

rebased onto 45cb749f3b1e0bde82789978aa3279467314a3cf

I've reviewed the changes commit by commit because doing them all at once it a pretty big diff ^_^.

This is looking good. Let's give it a final run of CI and get it in :)

Pull-Request has been merged by pingou

Metadata