Exemplo n.º 1
0
        public async Task Process(GithubIssuePayload payload)
        {
            var allowedUsers = Environment.GetEnvironmentVariable("AllowedUsers").Split(new [] { "," }, StringSplitOptions.RemoveEmptyEntries);

            foreach (var allowed in allowedUsers)
            {
                if (payload.issue.user.login.Equals(allowed, StringComparison.CurrentCultureIgnoreCase))
                {
                    return;
                }
            }

            if (!payload.issue.body.Contains(Environment.GetEnvironmentVariable("IssueTemplateMatch")))
            {
                _logger.LogDebug("Issue does not contain bug template");
                // Comment
                await _api.Comment(new Comment
                {
                    body = Environment.GetEnvironmentVariable("IssueTemplateNotFollowedText")
                }, payload.issue.number);

                // Close
                await _api.CloseIssue(payload.issue.number);

                return;
            }

            await _api.Comment(new Comment { body = Environment.GetEnvironmentVariable("GenericIssueMessage") }, payload.issue.number);
        }
Exemplo n.º 2
0
        public async Task Process(GithubIssuePayload payload)
        {
            var api = new ApiProcessor(Config);

            var defaultText = @"Hi!
Thanks for the issue report. Before a real human comes by, please make sure you used our bug report format.
Please make sure you also read our [FAQ](https://github.com/tidusjar/Ombi/wiki/FAQ)
Make the title describe your issue. Having ""not working"" or ""I get this bug"" for 100 issues, isn't really helpful.
If we need more information or there is some progress we tag the issue or update the tag and keep you updated.
Cheers!
Ombi Support";

            if (!payload.issue.body.Contains("Plex Requests.Net Version:"))
            {
                // Comment
                await api.Comment(new Comment
                {
                    body =
                        "Hello, Please use the Github template to report an issue, If it is a feature request then please visit: http://feathub.com/tidusjar/Ombi"
                }, payload.issue.number);

                // Close
                await api.CloseIssue(payload.issue.number);

                return;
            }

            await api.Comment(new Comment { body = defaultText }, payload.issue.number);
        }
Exemplo n.º 3
0
        public async Task Process(GithubIssuePayload payload)
        {
            var actions = new AdditionalActions();

            Api.Config = Config;

            var defaultText = @"Hi!
Thanks for the issue report. Before a real human comes by, please make sure you used our bug report format.
Have you looked on the forums yet? https://forums.ombi.io/
Before posting make sure you also read our [FAQ](https://github.com/tidusjar/Ombi/wiki/FAQ) and [known issues](https://github.com/tidusjar/Ombi/wiki/Known-Issues).
Make the title describe your issue. Having ""not working"" or ""I get this bug"" for 100 issues, isn't really helpful.
If we need more information or there is some progress we tag the issue or update the tag and keep you updated.
Cheers!
Ombi Support Team";

            var actionText = actions.Process(payload.issue.body);

            var adminRaised = payload.issue.user.login.Equals("TidusJar", StringComparison.CurrentCultureIgnoreCase) ||
                              payload.issue.user.login.Equals("SuperPotatoMen", StringComparison.CurrentCultureIgnoreCase);

            if (adminRaised)
            {
                return;
            }


            if (!string.IsNullOrEmpty(actionText))
            {
                // If we have an action then add a new comment first.
                await Api.Comment(new Comment { body = actionText }, payload.issue.number);
            }

            if (!payload.issue.body.Contains("Problem Description:"))
            {
                Console.WriteLine("Issue does not contain Ombi Version");
                // Comment
                await Api.Comment(new Comment
                {
                    body = @"Hello, Please use the Github template to report an issue, If it is a feature request then please visit: https://forums.ombi.io/viewforum.php?f=20
                            cheers!
                            Ombi Support Team"
                }, payload.issue.number);

                // Close
                await Api.CloseIssue(payload.issue.number);

                return;
            }

            await Api.Comment(new Comment { body = defaultText }, payload.issue.number);
        }