Skip to content

Commit

Permalink
ci: merge main to release
Browse files Browse the repository at this point in the history
ci: merge main to release
  • Loading branch information
rjsparks authored Nov 16, 2023
2 parents f5d4d74 + 569c713 commit aee3c6c
Show file tree
Hide file tree
Showing 145 changed files with 3,203 additions and 2,108 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build-base-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- 'main'
paths:
- 'docker/base.Dockerfile'
- 'requirements.txt'

workflow_dispatch:

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ jobs:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '16'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: '18'

Expand Down
816 changes: 414 additions & 402 deletions .pnp.cjs

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/cache/vue-npm-3.3.4-174fadbea4-58b6c62a66.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
975 changes: 619 additions & 356 deletions dev/coverage-action/package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dev/coverage-action/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
"luxon": "3.4.3"
},
"devDependencies": {
"eslint": "8.51.0",
"eslint": "8.52.0",
"eslint-config-standard": "17.1.0",
"eslint-plugin-import": "2.28.1",
"eslint-plugin-import": "2.29.0",
"eslint-plugin-node": "11.1.0",
"eslint-plugin-promise": "6.1.1",
"npm-check-updates": "16.14.6"
Expand Down
2 changes: 1 addition & 1 deletion docker/app.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ COPY docker/scripts/app-setup-debian.sh /tmp/library-scripts/docker-setup-debian
RUN sed -i 's/\r$//' /tmp/library-scripts/docker-setup-debian.sh && chmod +x /tmp/library-scripts/docker-setup-debian.sh

# Add Postgresql Apt Repository to get 14
RUN echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list
RUN echo "deb http://apt.postgresql.org/pub/repos/apt $(. /etc/os-release && echo "$VERSION_CODENAME")-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list
RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -

RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
Expand Down
29 changes: 23 additions & 6 deletions docker/base.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,30 @@ FROM python:3.9-bullseye
LABEL maintainer="IETF Tools Team <[email protected]>"

ENV DEBIAN_FRONTEND=noninteractive
ENV NODE_MAJOR=16

# Update system packages
RUN apt-get update \
&& apt-get -qy upgrade \
&& apt-get -y install --no-install-recommends apt-utils dialog 2>&1

# Add Node.js Source
RUN curl -fsSL https://deb.nodesource.com/setup_16.x | bash -
RUN apt-get install -y --no-install-recommends ca-certificates curl gnupg \
&& mkdir -p /etc/apt/keyrings\
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list

# Add Docker Source
RUN curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
RUN echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian \
$(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null

# Add PostgreSQL Source
RUN echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list
RUN echo "deb http://apt.postgresql.org/pub/repos/apt $(. /etc/os-release && echo "$VERSION_CODENAME")-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list
RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -

# Install the packages we need
RUN apt-get update --fix-missing && apt-get install -qy \
RUN apt-get update --fix-missing && apt-get install -qy --no-install-recommends \
apache2-utils \
apt-file \
bash \
Expand All @@ -30,6 +34,7 @@ RUN apt-get update --fix-missing && apt-get install -qy \
default-jdk \
docker-ce-cli \
enscript \
firefox-esr \
gawk \
g++ \
gcc \
Expand Down Expand Up @@ -58,7 +63,7 @@ RUN apt-get update --fix-missing && apt-get install -qy \
nano \
netcat \
nodejs \
pgloader \
pgloader \
pigz \
postgresql-client-14 \
pv \
Expand Down Expand Up @@ -87,11 +92,23 @@ RUN /tmp/app-install-chromedriver.sh
# Fix /dev/shm permissions for chromedriver
RUN chmod 1777 /dev/shm

# GeckoDriver
ARG GECKODRIVER_VERSION=latest
RUN GK_VERSION=$(if [ ${GECKODRIVER_VERSION:-latest} = "latest" ]; then echo "0.33.0"; else echo $GECKODRIVER_VERSION; fi) \
&& echo "Using GeckoDriver version: "$GK_VERSION \
&& wget --no-verbose -O /tmp/geckodriver.tar.gz https://github.com/mozilla/geckodriver/releases/download/v$GK_VERSION/geckodriver-v$GK_VERSION-linux64.tar.gz \
&& rm -rf /opt/geckodriver \
&& tar -C /opt -zxf /tmp/geckodriver.tar.gz \
&& rm /tmp/geckodriver.tar.gz \
&& mv /opt/geckodriver /opt/geckodriver-$GK_VERSION \
&& chmod 755 /opt/geckodriver-$GK_VERSION \
&& ln -fs /opt/geckodriver-$GK_VERSION /usr/bin/geckodriver

# Activate Yarn
RUN corepack enable

# Get rid of installation files we don't need in the image, to reduce size
RUN apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/*
RUN apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* /var/cache/apt/*

# "fake" dbus address to prevent errors
# https://github.com/SeleniumHQ/docker-selenium/issues/87
Expand Down
91 changes: 91 additions & 0 deletions ietf/doc/migrations/0008_alter_docevent_type.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# Generated by Django 4.2.7 on 2023-11-04 13:02

from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("doc", "0007_alter_docevent_type"),
]

operations = [
migrations.AlterField(
model_name="docevent",
name="type",
field=models.CharField(
choices=[
("new_revision", "Added new revision"),
("new_submission", "Uploaded new revision"),
("changed_document", "Changed document metadata"),
("added_comment", "Added comment"),
("added_message", "Added message"),
("edited_authors", "Edited the documents author list"),
("deleted", "Deleted document"),
("changed_state", "Changed state"),
("changed_stream", "Changed document stream"),
("expired_document", "Expired document"),
("extended_expiry", "Extended expiry of document"),
("requested_resurrect", "Requested resurrect"),
("completed_resurrect", "Completed resurrect"),
("changed_consensus", "Changed consensus"),
("published_rfc", "Published RFC"),
(
"added_suggested_replaces",
"Added suggested replacement relationships",
),
(
"reviewed_suggested_replaces",
"Reviewed suggested replacement relationships",
),
("changed_action_holders", "Changed action holders for document"),
("changed_group", "Changed group"),
("changed_protocol_writeup", "Changed protocol writeup"),
("changed_charter_milestone", "Changed charter milestone"),
("initial_review", "Set initial review time"),
("changed_review_announcement", "Changed WG Review text"),
("changed_action_announcement", "Changed WG Action text"),
("started_iesg_process", "Started IESG process on document"),
("created_ballot", "Created ballot"),
("closed_ballot", "Closed ballot"),
("sent_ballot_announcement", "Sent ballot announcement"),
("changed_ballot_position", "Changed ballot position"),
("changed_ballot_approval_text", "Changed ballot approval text"),
("changed_ballot_writeup_text", "Changed ballot writeup text"),
("changed_rfc_editor_note_text", "Changed RFC Editor Note text"),
("changed_last_call_text", "Changed last call text"),
("requested_last_call", "Requested last call"),
("sent_last_call", "Sent last call"),
("scheduled_for_telechat", "Scheduled for telechat"),
("iesg_approved", "IESG approved document (no problem)"),
("iesg_disapproved", "IESG disapproved document (do not publish)"),
("approved_in_minute", "Approved in minute"),
("iana_review", "IANA review comment"),
("rfc_in_iana_registry", "RFC is in IANA registry"),
(
"rfc_editor_received_announcement",
"Announcement was received by RFC Editor",
),
("requested_publication", "Publication at RFC Editor requested"),
(
"sync_from_rfc_editor",
"Received updated information from RFC Editor",
),
("requested_review", "Requested review"),
("assigned_review_request", "Assigned review request"),
("closed_review_request", "Closed review request"),
("closed_review_assignment", "Closed review assignment"),
("downref_approved", "Downref approved"),
("posted_related_ipr", "Posted related IPR"),
("removed_related_ipr", "Removed related IPR"),
(
"removed_objfalse_related_ipr",
"Removed Objectively False related IPR",
),
("changed_editors", "Changed BOF Request editors"),
("published_statement", "Published statement"),
("approved_slides", "Slides approved"),
],
max_length=50,
),
),
]
3 changes: 3 additions & 0 deletions ietf/doc/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1315,6 +1315,9 @@ class DocReminder(models.Model):

# Statement events
("published_statement", "Published statement"),

# Slide events
("approved_slides", "Slides approved"),

]

Expand Down
12 changes: 6 additions & 6 deletions ietf/doc/templatetags/ietf_filters.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright The IETF Trust 2007-2020, All Rights Reserved
# Copyright The IETF Trust 2007-2023, All Rights Reserved
# -*- coding: utf-8 -*-


Expand Down Expand Up @@ -409,18 +409,18 @@ def startswith(x, y):
return str(x).startswith(y)


@register.filter(name='removesuffix', is_safe=False)
def removesuffix(value, suffix):
"""Remove an exact-match suffix
@register.filter(name='removeprefix', is_safe=False)
def removeprefix(value, prefix):
"""Remove an exact-match prefix
The is_safe flag is False because indiscriminate use of this could result in non-safe output.
See https://docs.djangoproject.com/en/2.2/howto/custom-template-tags/#filters-and-auto-escaping
which describes the possibility that removing characters from an escaped string may introduce
HTML-unsafe output.
"""
base = str(value)
if base.endswith(suffix):
return base[:-len(suffix)]
if base.startswith(prefix):
return base[len(prefix):]
else:
return base

Expand Down
88 changes: 53 additions & 35 deletions ietf/doc/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,14 @@
from ietf.doc.models import ( Document, DocAlias, DocRelationshipName, RelatedDocument, State,
DocEvent, BallotPositionDocEvent, LastCallDocEvent, WriteupDocEvent, NewRevisionDocEvent, BallotType,
EditedAuthorsDocEvent )
from ietf.doc.factories import ( DocumentFactory, DocEventFactory, CharterFactory,
from ietf.doc.factories import ( DocumentFactory, DocEventFactory, CharterFactory,
ConflictReviewFactory, WgDraftFactory, IndividualDraftFactory, WgRfcFactory,
IndividualRfcFactory, StateDocEventFactory, BallotPositionDocEventFactory,
BallotDocEventFactory, DocumentAuthorFactory, NewRevisionDocEventFactory,
StatusChangeFactory, BofreqFactory, DocExtResourceFactory, RgDraftFactory)
StatusChangeFactory, DocExtResourceFactory, RgDraftFactory)
from ietf.doc.forms import NotifyForm
from ietf.doc.fields import SearchableDocumentsField
from ietf.doc.utils import create_ballot_if_not_open, uppercase_std_abbreviated_name
from ietf.doc.views_search import ad_dashboard_group, ad_dashboard_group_type, shorten_group_name # TODO: red flag that we're importing from views in tests. Move these to utils.
from ietf.group.models import Group, Role
from ietf.group.factories import GroupFactory, RoleFactory
from ietf.ipr.factories import HolderIprDisclosureFactory
Expand All @@ -60,6 +59,7 @@
from ietf.utils.test_utils import TestCase
from ietf.utils.text import normalize_text
from ietf.utils.timezone import date_today, datetime_today, DEADLINE_TZINFO, RPC_TZINFO
from ietf.doc.utils_search import AD_WORKLOAD


class SearchTests(TestCase):
Expand Down Expand Up @@ -279,43 +279,61 @@ def test_frontpage(self):
self.assertContains(r, "Document Search")

def test_ad_workload(self):
Role.objects.filter(name_id='ad').delete()
ad = RoleFactory(name_id='ad',group__type_id='area',group__state_id='active',person__name='Example Areadirector').person
doc_type_names = ['bofreq', 'charter', 'conflrev', 'draft', 'statchg']
expected = defaultdict(lambda :0)
for doc_type_name in doc_type_names:
if doc_type_name=='draft':
states = State.objects.filter(type='draft-iesg', used=True).values_list('slug', flat=True)
else:
states = State.objects.filter(type=doc_type_name, used=True).values_list('slug', flat=True)

for state in states:
target_num = random.randint(0,2)
Role.objects.filter(name_id="ad").delete()
ad = RoleFactory(
name_id="ad",
group__type_id="area",
group__state_id="active",
person__name="Example Areadirector",
).person
expected = defaultdict(lambda: 0)
for doc_type_slug in AD_WORKLOAD:
for state in AD_WORKLOAD[doc_type_slug]:
target_num = random.randint(0, 2)
for _ in range(target_num):
if doc_type_name == 'draft':
doc = IndividualDraftFactory(ad=ad,states=[('draft-iesg', state),('draft','rfc' if state=='pub' else 'active')])
elif doc_type_name == 'charter':
doc = CharterFactory(ad=ad, states=[(doc_type_name, state)])
elif doc_type_name == 'bofreq':
# Note that the view currently doesn't handle bofreqs
doc = BofreqFactory(states=[(doc_type_name, state)], bofreqresponsibledocevent__responsible=[ad])
elif doc_type_name == 'conflrev':
doc = ConflictReviewFactory(ad=ad, states=State.objects.filter(type_id=doc_type_name, slug=state))
elif doc_type_name == 'statchg':
doc = StatusChangeFactory(ad=ad, states=State.objects.filter(type_id=doc_type_name, slug=state))
else:
# Currently unreachable
doc = DocumentFactory(type_id=doc_type_name, ad=ad, states=[(doc_type_name, state)])

if not slugify(ad_dashboard_group_type(doc)) in ('document', 'none'):
expected[(slugify(ad_dashboard_group_type(doc)), slugify(ad.full_name_as_key()), slugify(shorten_group_name(ad_dashboard_group(doc))))] += 1

url = urlreverse('ietf.doc.views_search.ad_workload')
if (
doc_type_slug == "draft"
or doc_type_slug == "rfc"
and state == "rfcqueue"
):
IndividualDraftFactory(
ad=ad,
states=[
("draft-iesg", state),
("draft", "rfc" if state == "pub" else "active"),
],
)
elif doc_type_slug == "rfc":
WgRfcFactory.create(
states=[("draft", "rfc"), ("draft-iesg", "pub")]
)

elif doc_type_slug == "charter":
CharterFactory(ad=ad, states=[(doc_type_slug, state)])
elif doc_type_slug == "conflrev":
ConflictReviewFactory(
ad=ad,
states=State.objects.filter(
type_id=doc_type_slug, slug=state
),
)
elif doc_type_slug == "statchg":
StatusChangeFactory(
ad=ad,
states=State.objects.filter(
type_id=doc_type_slug, slug=state
),
)
self.client.login(username="ad", password="ad+password")
url = urlreverse("ietf.doc.views_search.ad_workload")
r = self.client.get(url)
self.assertEqual(r.status_code, 200)
q = PyQuery(r.content)
for group_type, ad, group in expected:
self.assertEqual(int(q(f'#{group_type}-{ad}-{group}').text()),expected[(group_type, ad, group)])
self.assertEqual(
int(q(f"#{group_type}-{ad}-{group}").text()),
expected[(group_type, ad, group)],
)

def test_docs_for_ad(self):
ad = RoleFactory(name_id='ad',group__type_id='area',group__state_id='active').person
Expand Down
1 change: 1 addition & 0 deletions ietf/doc/urls_review.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
url(r'^(?P<request_id>[0-9]+)/$', views_review.review_request),
url(r'^(?P<request_id>[0-9]+)/login/$', views_review.review_request_forced_login),
url(r'^(?P<request_id>[0-9]+)/close/$', views_review.close_request),
url(r'^(?P<request_id>[0-9]+)/addrequestcomment/$', views_review.add_request_comment),
url(r'^(?P<request_id>[0-9]+)/assignreviewer/$', views_review.assign_reviewer),
url(r'^(?P<assignment_id>[0-9]+)/rejectreviewerassignment/$', views_review.reject_reviewer_assignment),
url(r'^(?P<assignment_id>[0-9]+)/complete/$', views_review.complete_review),
Expand Down
Loading

0 comments on commit aee3c6c

Please sign in to comment.