Skip to content

Commit a0726c8

Browse files
Merge pull request #4774 from linuxfoundation/unicron-fix-github-installation-id
Fix github installation_id
2 parents 0f2b189 + 83175fa commit a0726c8

File tree

2 files changed

+24
-10
lines changed

2 files changed

+24
-10
lines changed

cla-backend/cla/models/dynamo_models.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4000,6 +4000,10 @@ def __str__(self):
40004000
)
40014001

40024002
def to_dict(self):
4003+
if getattr(self.model, 'skip_cla', None) is None:
4004+
self.model.skip_cla = {}
4005+
if getattr(self.model, 'enable_co_authors', None) is None:
4006+
self.model.enable_co_authors = {}
40034007
ret = dict(self.model)
40044008

40054009
if "organization_installation_id" not in ret:

utils/search_aws_log_group.sh

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,24 +35,34 @@ then
3535
exit 2
3636
fi
3737

38+
to_epoch_ms () {
39+
local v="$1"
40+
if [[ "$v" =~ ^[0-9]{13}$ ]]
41+
then
42+
echo "$v"; return
43+
fi
44+
if [[ "$v" =~ ^[0-9]{10}$ ]]
45+
then
46+
echo "${v}000"; return
47+
fi
48+
v="${v/T/ }"
49+
v="${v/Z/ UTC}"
50+
echo "$(date -d "$v" +%s)000"
51+
}
52+
3853
if [ -z "${DTFROM}" ]
3954
then
40-
export DTFROM="$(date -d '3 days ago' +%s)000"
55+
export DTFROM="$(to_epoch_ms '3 days ago')"
4156
else
42-
if [[ ! "$DTFROM" =~ ^[0-9]+$ ]]
43-
then
44-
export DTFROM="$(date -d "${DTFROM}" +%s)000"
45-
fi
57+
export DTFROM="$(to_epoch_ms "${DTFROM}")"
4658
fi
4759

60+
# DTTO
4861
if [ -z "${DTTO}" ]
4962
then
50-
export DTTO="$(date +%s)000"
63+
export DTTO="$(to_epoch_ms 'now')"
5164
else
52-
if [[ ! "$DTTO" =~ ^[0-9]+$ ]]
53-
then
54-
export DTTO="$(date -d "${DTTO}" +%s)000"
55-
fi
65+
export DTTO="$(to_epoch_ms "${DTTO}")"
5666
fi
5767

5868
if [ ! -z "${DEBUG}" ]

0 commit comments

Comments
 (0)