Skip to content

Conversation

wilzbach
Copy link
Contributor

No description provided.

Copy link
Contributor Author

@wilzbach wilzbach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.

@@ -0,0 +1,67 @@
[
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry - with the issue API we can directly get the correct subset :)

source/app.d Outdated
settings.bindAddresses = ["0.0.0.0"];
settings.options = HTTPServerOption.defaults & ~HTTPServerOption.parseJsonBody;

lastFullPRCheck = SysTime(Date(0, 1, 1));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: SysTime.min is there, but didn't work. I guess it underflows?

Copy link
Member

@MartinNowak MartinNowak Dec 19, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Supposed to work, but Duration represents differences of hnsecs.
https://dlang.org/library/std/datetime/sys_time.min.html

import std.datetime;
Clock.currTime - SysTime.min;

-1419840 weeks, -3 days, -2 hours, -21 minutes, -37 secs, -762 ms, -353 μs, and -8 hnsecs

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use MonoTime instead.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or check relatively lastFullPRCheck + 5.minutes > Clock.currTime.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not important though

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SysTime.init is zero and won't overflow, both SysTime and Duration use long hnsecs internally.

source/app.d Outdated

void searchForAutoMergePrs(string repoSlug)
{
auto issues = ghGetRequest("%s/repos/%s/issues?state=open&labels=auto-merge,auto-merge-squash"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately this is a logical AND between the labels, see https://github.com/api/repos/dlang/phobos/issues?state=open&labels=blocked,dependency. Searched the net, there doesn't seem to be an OR, so we'd need 2 queries (and maybe an intersection :/).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately this is a logical AND between the labels,

Wow good catch! -> updated

@MartinNowak MartinNowak merged commit fb81dc1 into dlang:master Dec 19, 2016
@MartinNowak
Copy link
Member

Will deploy this later.

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

Successfully merging this pull request may close these issues.

2 participants