Beispiel #1
0
        /// <summary>
        /// The main.
        /// </summary>
        /// <param name="args">
        /// The args.
        /// </param>
        private static void Main(string[] args)
        {
            // --------------------------------------------------------------------//
            // Don't change this from scimonshouse.net or you'll leak credentials! //
            // This is an internal-only development install
            // --------------------------------------------------------------------//
            string phabUrl = "https://phabricator.stwalkerster.co.uk/";

            phabUrl = "https://fab.scimonshouse.net/";

            string token = "api-pthzak4snefxww3rzllecspgilpj";


            token = "api-rul3ssevvzaedtdqxhdhg6sfzajv";

            var client = new ConduitClient(phabUrl, token);

            var maniphest = new Maniphest(client);

            var constraint = ManiphestSearchConstraintFactory.Statuses(new List <string> {
                "open"
            });
            var searchConstraints = new List <ApplicationEditorSearchConstraint> {
                constraint
            };
            IEnumerable <ManiphestTask> response = maniphest.Search(constraints: searchConstraints).ToList();
        }
Beispiel #2
0
        public void ReportBug(BugException ex)
        {
            if (!this.active)
            {
                return;
            }

            try
            {
                var fulltext = new ApplicationEditorSearchConstraint("query", ex.Title);
                var statuses = ManiphestSearchConstraintFactory.Statuses(new List <string> {
                    "open", "stalled"
                });

                var maniphestTasks = this.maniphest.Search(constraints: new[] { fulltext, statuses });

                var fod = maniphestTasks.FirstOrDefault(x => x.Title == ex.Title);
                if (fod == null)
                {
                    fod = new ManiphestTask
                    {
                        Title       = ex.Title,
                        Description = ex.Description,
                        Priority    = "normal",
                        Points      = 1
                    };
                    fod.AddProjects(this.projectPhid);
                }
                else
                {
                    fod.AddComment(ex.Description);
                    fod.Points = fod.Points.GetValueOrDefault(0) + 1;
                }

                this.maniphest.Edit(fod);
            }
            catch (Exception ex2)
            {
                this.logger.Warn("Exception while logging bug", ex2);
                this.logger.Error("Exception encountered while logging bug; including here for reference", ex);
            }
        }