#2255 Add the ability to watch issues and PRs, commits, or both on a project
Merged by pingou. Opened by mprahl.
Unknown source master

Download 2255.patch

As a heads up, the first few commits were a couple of bug fixes.

Additionally, I'm not sure how to test the email notification in the git hook practically and through unit tests. It seems to call the send_email function as I'd expect but I don't know for sure since I don't have a mail server configured. If you have any ideas, I'd appreciate it.

doesn't this duplicate the email hook?

looks like you fixed the typo above but missed it here (selected)

4 new commits added

  • Add different levels of granularity for watching a project and fix flake8 errors for tests to pass
  • Add missing import in pagure_logcom_server
  • Correct variable name in pagure_logcom_server
  • Use 'os.path.realpath' in 'get_repo_namespace' to resolve an issue when a symbolic link was being used for APP.config['GIT_FOLDER']

1 new commit added

  • Transition commit notification emails to use Redis

5 new commits added

  • Add different levels of granularity for watching a project and fix flake8 errors for tests to pass
  • Fix imports in pagure_loadjson_server.py
  • Add missing import in pagure_logcom_server
  • Correct variable name in pagure_logcom_server
  • Use 'os.path.realpath' in 'get_repo_namespace' to resolve an issue when a symbolic link was being used for APP.config['GIT_FOLDER']

Pretty please pagure-ci rebuild

We can't create a column nullable=False directly since there will be data in the table and that column will thus be null upon creation. So we need to create it as nullable=True, set some data in it and then alter it to nullable=False

EDIT: I think I tried it with server_default but I'm not sure anymore suddenly, so I'll give this a try first

This is not actually the right service, this one is triggered by pushes made to the ticket or request repo. We should adjust the logcom (log commit) service for this (it's the one that updates the calendar heatmap to reflect the commits in the activity of the users).

Should we check that watch is in ['1', '2', '3'] first and warn if it is not?

Yes, good point.

5 new commits added

  • Add different levels of granularity for watching a project and fix flake8 errors for tests to pass
  • Fix imports in pagure_loadjson_server.py
  • Add missing import in pagure_logcom_server
  • Correct variable name in pagure_logcom_server
  • Use 'os.path.realpath' in 'get_repo_namespace' to resolve an issue when a symbolic link was being used for APP.config['GIT_FOLDER']

5 new commits added

  • Add different levels of granularity for watching a project and fix flake8 errors for tests to pass
  • Fix imports in pagure_loadjson_server.py
  • Add missing import in pagure_logcom_server
  • Correct variable name in pagure_logcom_server
  • Use 'os.path.realpath' in 'get_repo_namespace' to resolve an issue when a symbolic link was being used for APP.config['GIT_FOLDER']

rebased

I wonder if instead of calling the function in the template we shouldn't do that in the controller and just pass the output to the template, what do you think?

5 new commits added

  • Add different levels of granularity for watching a project and fix flake8 errors for tests to pass
  • Fix imports in pagure_loadjson_server.py
  • Add missing import in pagure_logcom_server
  • Correct variable name in pagure_logcom_server
  • Use 'os.path.realpath' in 'get_repo_namespace' to resolve an issue when a symbolic link was being used for APP.config['GIT_FOLDER']

I like that idea. I was trying to keep it more or less like you had it before when you were calling is_watching. If there's no reason to keep it like that, I will try to change it.

6 new commits added

  • Move pagure.lib.get_watch_level_on_repo function call to
  • Add different levels of granularity for watching a project and fix flake8 errors for tests to pass
  • Fix imports in pagure_loadjson_server.py
  • Add missing import in pagure_logcom_server
  • Correct variable name in pagure_logcom_server
  • Use 'os.path.realpath' in 'get_repo_namespace' to resolve an issue when a symbolic link was being used for APP.config['GIT_FOLDER']

I'm thinking we may want this section to be before the one for # Add/Remove people who explicitly asked to be added/removed

Yes, you're right. Let me fix that.

5 new commits added

  • Add different levels of granularity for watching a project and fix flake8 errors for tests to pass
  • Fix imports in pagure_loadjson_server.py
  • Add missing import in pagure_logcom_server
  • Correct variable name in pagure_logcom_server
  • Use 'os.path.realpath' in 'get_repo_namespace' to resolve an issue when a symbolic link was being used for APP.config['GIT_FOLDER']

The tests are failing now. I'll look into it later.

Edit:
This is ready for review again.

5 new commits added

  • Add different levels of granularity for watching a project and fix flake8 errors for tests to pass
  • Fix imports in pagure_loadjson_server.py
  • Add missing import in pagure_logcom_server
  • Correct variable name in pagure_logcom_server
  • Use 'os.path.realpath' in 'get_repo_namespace' to resolve an issue when a symbolic link was being used for APP.config['GIT_FOLDER']

As per our conversation, we will replace server_default.

Edit: This is now replaced in a new commit

8 new commits added

  • Add a project watchers API endpoint
  • Remove server_default in the add_granularity_to_watching_repos migration
  • Add different levels of granularity for watching a project and fix flake8 errors for tests to pass
  • Add missing decorator for api_git_branches
  • Fix imports in pagure_loadjson_server.py
  • Add missing import in pagure_logcom_server
  • Correct variable name in pagure_logcom_server
  • Use 'os.path.realpath' in 'get_repo_namespace' to resolve an issue when a symbolic link was being used for APP.config['GIT_FOLDER']

8 new commits added

  • Add a project watchers API endpoint
  • Remove server_default in the add_granularity_to_watching_repos migration
  • Add different levels of granularity for watching a project and fix flake8 errors for tests to pass
  • Add missing decorator for api_git_branches
  • Fix imports in pagure_loadjson_server.py
  • Add missing import in pagure_logcom_server
  • Correct variable name in pagure_logcom_server
  • Use 'os.path.realpath' in 'get_repo_namespace' to resolve an issue when a symbolic link was being used for APP.config['GIT_FOLDER']

rebased

Pretty please pagure-ci rebuild

Pretty please pagure-ci rebuild

Pretty please pagure-ci rebuild

Pretty please pagure-ci rebuild

Pretty please pagure-ci rebuild

@pingou I can't get the unit tests to actually run in Jenkins. Can you check the Jenkins setup when you can please?

Pull-Request has been merged by pingou

Metadata