Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore commands in quotes #52

Closed
pietroalbini opened this issue Jun 29, 2019 · 1 comment · Fixed by #124
Closed

Ignore commands in quotes #52

pietroalbini opened this issue Jun 29, 2019 · 1 comment · Fixed by #124
Labels
good first issue Good for newcomers

Comments

@pietroalbini
Copy link
Member

There is another edge case in homu command handling: when an user replies to a comment via email by default the parent command is quoted, and the old parser code tried to handle it. We should ignore commands when the line starts with >, to hopefully catch quoted emails, or if the new parser already handles this a test should be added.

Example: rust-lang/rust#61540 (comment)

@bryanburgers
Copy link
Contributor

This is a good first issue for somebody new to Homu.

A little guidance for somebody taking this task:

  • Create a test similar to
    def test_r_me():
    """
    Ignore r=me
    """
    author = "jack"
    body = "@bors r=me"
    commands = parse_issue_comment(author, body, commit, "bors")
    # r=me is not a valid command, so no valid commands.
    assert len(commands) == 0
    that sets the body variable to a comment you might expect – one that includes a > @bors valid command. Probably assert that len(commands) == 0?
  • Observe that the test fails when you run python3 setup.py test.
  • Update
    def parse_issue_comment(username, body, sha, botname, hooks=[]):
    to pass the test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants