Skip to content

Commit

Permalink
Merge branch 'main' into feat/iabstatements
Browse files Browse the repository at this point in the history
  • Loading branch information
rjsparks authored Jul 23, 2023
2 parents e31b1af + 14b4f82 commit b9a3570
Show file tree
Hide file tree
Showing 244 changed files with 603 additions and 532 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ Click the <kbd>Fork</kbd> button in the top-right corner of the repository to cr

As outlined in the [Contributing](https://github.com/ietf-tools/.github/blob/main/CONTRIBUTING.md) guide, you will first want to create a fork of the datatracker project in your personal GitHub account before cloning it.

Windows developers: [Start with WSL2 from the beginning](https://github.com/ietf-tools/.github/blob/main/docs/windows-dev.md).

Because of the extensive history of this project, cloning the datatracker project locally can take a long time / disk space. You can speed up the cloning process by limiting the history depth, for example *(replace `USERNAME` with your GitHub username)*:

- To fetch only up to the 10 latest commits:
Expand Down
4 changes: 2 additions & 2 deletions client/agenda/Agenda.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
span.meeting-warning(v-if='agendaStore.meeting.warningNote') {{agendaStore.meeting.warningNote}}
h4
span {{agendaStore.meeting.city}}, {{ meetingDate }}
h6.float-end.d-none.d-lg-inline(v-if='meetingUpdated') #[span.text-muted Updated:] {{ meetingUpdated }}
h6.float-end.d-none.d-lg-inline(v-if='meetingUpdated') #[span.text-body-secondary Updated:] {{ meetingUpdated }}

.agenda-topnav.my-3
meeting-navigation
Expand Down Expand Up @@ -49,7 +49,7 @@
n-popover(v-if='!agendaStore.infoNoteShown')
template(#trigger)
n-button.ms-2(text, @click='toggleInfoNote')
i.bi.bi-info-circle.text-muted
i.bi.bi-info-circle.text-body-secondary
span Show Info Note
.col-12.col-sm-auto.d-flex.align-items-center
i.bi.bi-globe.me-2
Expand Down
4 changes: 2 additions & 2 deletions client/agenda/AgendaQuickAccess.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
)
i.bi.bi-x-square.me-2
span Discard
n-divider: small.text-muted Calendar
n-divider: small.text-body-secondary Calendar
n-button.mt-2(
id='agenda-quickaccess-calview-btn'
block
Expand Down Expand Up @@ -86,7 +86,7 @@
i.bi.bi-calendar-check.me-2
span {{ shortMode ? '.ics' : 'Add to your calendar...' }}
template(v-if='agendaStore.meetingDays.length > 0')
n-divider: small.text-muted Jump to...
n-divider: small.text-body-secondary Jump to...
ul.nav.nav-pills.flex-column.small.agenda-quickaccess-jumpto
li.nav-item(v-if='agendaStore.isMeetingLive')
a.nav-link(
Expand Down
2 changes: 1 addition & 1 deletion client/agenda/AgendaShareModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ n-modal(v-model:show='modalShown')
i.bi.bi-share
span Share this view
.agenda-share-content
.text-muted.pb-2 Use the following URL for sharing the current view #[em (including any active filters)] with other users:
.text-body-secondary.pb-2 Use the following URL for sharing the current view #[em (including any active filters)] with other users:
n-input-group
n-input(
ref='filteredUrlIpt'
Expand Down
2 changes: 1 addition & 1 deletion client/components/ChatLog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
)
template(#default)
div(v-html='item.text')
span.text-muted(v-else)
span.text-body-secondary(v-else)
em No chat log available.
</template>

Expand Down
2 changes: 1 addition & 1 deletion client/components/Polls.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
:columns='columns'
striped
)
span.text-muted(v-else)
span.text-body-secondary(v-else)
em No polls available.
</template>

Expand Down
14 changes: 7 additions & 7 deletions dev/diff/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dev/diff/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "diff",
"type": "module",
"dependencies": {
"chalk": "^5.2.0",
"chalk": "^5.3.0",
"dockerode": "^3.3.5",
"enquirer": "^2.3.6",
"extract-zip": "^2.0.1",
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ services:
CELERY_APP: ietf
CELERY_ROLE: worker
UPDATE_REQUIREMENTS_FROM: requirements.txt
DEV_MODE: yes
DEV_MODE: "yes"
command:
- '--loglevel=INFO'
depends_on:
Expand Down
20 changes: 8 additions & 12 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ This project includes a devcontainer configuration which automates the setup of
### Initial Setup

1. Launch [VS Code](https://code.visualstudio.com/)
2. Under the **Extensions** tab, ensure you have the **Remote - Containers** ([ms-vscode-remote.remote-containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)) extension installed.
2. Under the **Extensions** tab, ensure you have the **Dev Containers** ([ms-vscode-remote.remote-containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)) extension installed.
* On Linux, note that the Snap installation of VS Code is [incompatible with this plugin](https://code.visualstudio.com/docs/devcontainers/containers#_system-requirements:~:text=snap%20package%20is%20not%20supported).
* On Windows, you also need the **Remote - WSL** ([ms-vscode-remote.remote-wsl](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl)) extension to take advantage of the WSL 2 *(Windows Subsystem for Linux)* native integration.
* On Windows, you also need the **WSL** ([ms-vscode-remote.remote-wsl](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl)) extension to take advantage of the WSL 2 *(Windows Subsystem for Linux)* native integration.
2. Open the top-level directory of the datatracker code you fetched above.
3. A prompt inviting you to reopen the project in containers will appear in the bottom-right corner. Click the **Reopen in Container** button. If you missed the prompt, you can press `F1`, start typing `reopen in container` task and launch it.
4. VS Code will relaunch in the dev environment and create the containers automatically.
Expand All @@ -45,7 +45,7 @@ You can also open the datatracker project folder and click the **Reopen in conta

### Usage

- Under the **Run and Debug** tab, you can run the server with the debugger attached using **Run Server** (F5). Once the server is ready to accept connections, you'll be prompted to open in a browser. You can also open [http://localhost:8000](http://localhost:8000) in a browser.
- Under the **Run and Debug** tab, you can run the server with the debugger attached using **Run Server** (F5). Once the server is ready to accept connections, you'll be prompted to open in a browser. Navigate to [http://localhost:8000](http://localhost:8000) in your preferred browser.
> An alternate profile **Run Server with Debug Toolbar** is also available from the dropdown menu, which displays various tools
on top of the webpage. However, note that this configuration has a significant performance impact.
Expand All @@ -64,11 +64,7 @@ You can also open the datatracker project folder and click the **Reopen in conta
![](assets/vscode-terminal-new.png)
- Under the **SQL Tools** tab, a connection **Local Dev** is preconfigured to connect to the DB container. Using this tool, you can list tables, view records and execute SQL queries directly from VS Code.
> The port `3306` is also exposed to the host automatically, should you prefer to use your own SQL tool.
![](assets/vscode-sqltools.png)
- The pgAdmin web interface, a PostgreSQL DB browser / management UI, is available at [http://localhost:8000/pgadmin/](http://localhost:8000/pgadmin/).
- Under the **Task Explorer** tab, a list of available preconfigured tasks is displayed. *(You may need to expand the tree to `src > vscode` to see it.)* These are common scritps you can run *(e.g. run tests, fetch assets, etc.)*.
Expand Down Expand Up @@ -103,7 +99,7 @@ You can also open the datatracker project folder and click the **Reopen in conta
2. Wait for the containers to initialize. Upon completion, you will be dropped into a shell from which you can start the datatracker and execute related commands as usual, for example

```
ietf/manage.py runserver 0.0.0.0:8000
ietf/manage.py runserver 0.0.0.0:8001
```

to start the datatracker.
Expand Down Expand Up @@ -161,11 +157,11 @@ docker compose down -v --rmi all
docker image prune
```

### Accessing MariaDB Port
### Accessing PostgreSQL Port

The port is exposed but not mapped to `3306` to avoid potential conflicts with the host. To get the mapped port, run the command *(from the project `/docker` directory)*:
The port is exposed but not automatically mapped to `5432` to avoid potential conflicts with the host. To get the mapped port, run the command *(from the project `/docker` directory)*:
```sh
docker compose port db 3306
docker compose port db 5432
```

## Notes / Troubleshooting
Expand Down
9 changes: 9 additions & 0 deletions ietf/api/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -725,6 +725,15 @@ def test_api_appauth(self):
self.assertEqual(r.status_code, 200)
jsondata = r.json()
self.assertEqual(jsondata['success'], True)

def test_api_get_session_matherials_no_agenda_meeting_url(self):
meeting = MeetingFactory(type_id='ietf')
session = SessionFactory(meeting=meeting)
url = urlreverse('ietf.meeting.views.api_get_session_materials', kwargs={'session_id': session.pk})
r = self.client.get(url)
self.assertEqual(r.status_code, 200)



class DirectAuthApiTests(TestCase):

Expand Down
2 changes: 1 addition & 1 deletion ietf/community/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def view_list(request, username=None):
docs = docs_tracked_by_community_list(clist)
docs, meta = prepare_document_table(request, docs, request.GET)

subscribed = request.user.is_authenticated and EmailSubscription.objects.filter(community_list=clist, email__person__user=request.user)
subscribed = request.user.is_authenticated and (EmailSubscription.objects.none() if clist.pk is None else EmailSubscription.objects.filter(community_list=clist, email__person__user=request.user))

return render(request, 'community/view_list.html', {
'clist': clist,
Expand Down
22 changes: 22 additions & 0 deletions ietf/doc/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,17 @@ def test_search_for_name(self):
parsed = urlparse(r["Location"])
self.assertEqual(parsed.path, urlreverse('ietf.doc.views_search.search'))
self.assertEqual(parse_qs(parsed.query)["name"][0], "draft-ietf-doesnotexist-42")

def test_search_rfc(self):
rfc = WgRfcFactory(name="rfc0000")

# search for existing RFC should redirect directly to the RFC page
r = self.client.get(urlreverse('ietf.doc.views_search.search_for_name', kwargs=dict(name=rfc.name)))
self.assertRedirects(r, f'/doc/{rfc.name}/', status_code=302, target_status_code=200)

# search for existing RFC with revision number should redirect to the RFC page
r = self.client.get(urlreverse('ietf.doc.views_search.search_for_name', kwargs=dict(name=rfc.name + "-99")), follow=True)
self.assertRedirects(r, f'/doc/{rfc.name}/', status_code=302, target_status_code=200)

def test_frontpage(self):
r = self.client.get("/")
Expand Down Expand Up @@ -1617,6 +1628,10 @@ def test_document_charter(self):
CharterFactory(name='charter-ietf-mars')
r = self.client.get(urlreverse("ietf.doc.views_doc.document_main", kwargs=dict(name="charter-ietf-mars")))
self.assertEqual(r.status_code, 200)

def test_incorrect_rfc_url(self):
r = self.client.get(urlreverse("ietf.doc.views_doc.document_main", kwargs=dict(name="rfc8989", rev="00")))
self.assertEqual(r.status_code, 404)

def test_document_conflict_review(self):
ConflictReviewFactory(name='conflict-review-imaginary-irtf-submission')
Expand Down Expand Up @@ -1993,6 +2008,12 @@ def test_document_bibtex(self):
#
self.assertNotIn('day', entry)

# test for incorrect case - revision for RFC
rfc = WgRfcFactory(name="rfc0000")
url = urlreverse('ietf.doc.views_doc.document_bibtex', kwargs=dict(name=rfc.name, rev='00'))
r = self.client.get(url)
self.assertEqual(r.status_code, 404)

april1 = IndividualRfcFactory.create(
stream_id = 'ise',
states = [('draft','rfc'),('draft-iesg','pub')],
Expand Down Expand Up @@ -2585,6 +2606,7 @@ def test_personal_chart(self):
d = r.json()
self.assertEqual(len(d), 1)
self.assertEqual(len(d[0]), 2)
self.assertEqual(d[0][1], 1)

page_url = urlreverse('ietf.person.views.profile', kwargs=dict(email_or_name=person.name))
r = self.client.get(page_url)
Expand Down
26 changes: 24 additions & 2 deletions ietf/doc/tests_status_change.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from django.conf import settings
from django.urls import reverse as urlreverse

from ietf.doc.factories import DocumentFactory, IndividualRfcFactory, WgRfcFactory
from ietf.doc.factories import DocumentFactory, IndividualRfcFactory, WgRfcFactory, DocEventFactory
from ietf.doc.models import ( Document, DocAlias, State, DocEvent,
BallotPositionDocEvent, NewRevisionDocEvent, TelechatDocEvent, WriteupDocEvent )
from ietf.doc.utils import create_ballot_if_not_open
Expand Down Expand Up @@ -86,6 +86,16 @@ def test_start_review(self):
status_change = Document.objects.get(name='status-change-imaginary-new2')
self.assertIsNone(status_change.ad)

# Verify that the right thing happens if a control along the way uppercases RFC
r = self.client.post(url,dict(
document_name="imaginary-new3",title="A new imaginary status change",
create_in_state=state_strpk,notify='[email protected]',new_relation_row_blah="RFC9999",
statchg_relation_row_blah="tois")
)
self.assertEqual(r.status_code, 302)
status_change = Document.objects.get(name='status-change-imaginary-new3')
self.assertTrue(status_change.relateddocument_set.filter(relationship__slug='tois',target__name='rfc9999'))


def test_change_state(self):

Expand Down Expand Up @@ -289,7 +299,19 @@ def test_edit_lc(self):
self.assertEqual(r.status_code,200)
self.assertContains(r, 'RFC9999 from Proposed Standard to Internet Standard')
self.assertContains(r, 'RFC9998 from Informational to Historic')

q = PyQuery(r.content)
self.assertEqual(len(q("button[name='send_last_call_request']")), 1)

# Make sure request LC isn't offered with no responsible AD.
doc.ad = None
doc.save_with_history([DocEventFactory(doc=doc)])
r = self.client.get(url)
self.assertEqual(r.status_code,200)
q = PyQuery(r.content)
self.assertEqual(len(q("button[name='send_last_call_request']")), 0)
doc.ad = Person.objects.get(name='Ad No2')
doc.save_with_history([DocEventFactory(doc=doc)])

# request last call
messages_before = len(outbox)
r = self.client.post(url,dict(last_call_text='stuff',send_last_call_request='Save+and+Request+Last+Call'))
Expand Down
2 changes: 1 addition & 1 deletion ietf/doc/views_ballot.py
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@ def ballot_rfceditornote(request, name):
e = WriteupDocEvent(doc=doc, rev=doc.rev, by=login)
e.by = login
e.type = "changed_rfc_editor_note_text"
e.desc = "RFC Editor Note was changed"
e.desc = f"RFC Editor Note was changed to \n{t}"
e.text = t.rstrip()
e.save()

Expand Down
11 changes: 11 additions & 0 deletions ietf/doc/views_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,9 @@ def interesting_doc_relations(doc):
return interesting_relations_that, interesting_relations_that_doc

def document_main(request, name, rev=None, document_html=False):
if name.startswith("rfc") and rev is not None:
raise Http404()

doc = get_object_or_404(Document.objects.select_related(), docalias__name=name)

# take care of possible redirections
Expand Down Expand Up @@ -1113,6 +1116,9 @@ def document_history(request, name):


def document_bibtex(request, name, rev=None):
if name.startswith('rfc') and rev is not None:
raise Http404()

# Make sure URL_REGEXPS did not grab too much for the rev number
if rev != None and len(rev) != 2:
mo = re.search(r"^(?P<m>[0-9]{1,2})-(?P<n>[0-9]{2})$", rev)
Expand Down Expand Up @@ -1145,6 +1151,11 @@ def document_bibtex(request, name, rev=None):
else:
doi = None

if doc.is_dochistory():
latest_event = doc.latest_event(type='new_revision', rev=rev)
if latest_event:
doc.pub_date = latest_event.time

return render(request, "doc/document_bibtex.bib",
dict(doc=doc,
replaced_by=replaced_by,
Expand Down
5 changes: 1 addition & 4 deletions ietf/doc/views_review.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,9 +389,6 @@ def reject_reviewer_assignment(request, name, assignment_id):
state=review_assignment.state,
)

policy = get_reviewer_queue_policy(review_assignment.review_request.team)
policy.return_reviewer_to_rotation_top(review_assignment.reviewer.person, form.cleaned_data['wants_to_be_next'])

msg = render_to_string("review/reviewer_assignment_rejected.txt", {
"by": request.user.person,
"message_to_secretary": form.cleaned_data.get("message_to_secretary"),
Expand Down Expand Up @@ -441,7 +438,7 @@ def withdraw_reviewer_assignment(request, name, assignment_id):
)

policy = get_reviewer_queue_policy(review_assignment.review_request.team)
policy.return_reviewer_to_rotation_top(review_assignment.reviewer.person, True)
policy.set_wants_to_be_next(review_assignment.reviewer.person)

msg = "Review assignment withdrawn by %s"%request.user.person

Expand Down
4 changes: 2 additions & 2 deletions ietf/doc/views_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,8 @@ def cached_redirect(cache_key, url):
redirect_to = find_unique(rev_split.group(1))
if redirect_to:
rev = rev_split.group(2)
# check if we can redirect directly to the rev
if DocHistory.objects.filter(doc__docalias__name=redirect_to, rev=rev).exists():
# check if we can redirect directly to the rev if it's draft, if rfc - always redirect to main page
if not redirect_to.startswith('rfc') and DocHistory.objects.filter(doc__docalias__name=redirect_to, rev=rev).exists():
return cached_redirect(cache_key, urlreverse("ietf.doc.views_doc.document_main", kwargs={ "name": redirect_to, "rev": rev }))
else:
return cached_redirect(cache_key, urlreverse("ietf.doc.views_doc.document_main", kwargs={ "name": redirect_to }))
Expand Down
2 changes: 1 addition & 1 deletion ietf/doc/views_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def model_to_timeline_data(model, field='time', **kwargs):
assert field in [ f.name for f in model._meta.get_fields() ]

objects = ( model.objects.filter(**kwargs)
.annotate(date=TruncDate(field))
.annotate(date=TruncDate(field, tzinfo=datetime.timezone.utc))
.order_by('date')
.values('date')
.annotate(count=Count('id')))
Expand Down
Loading

0 comments on commit b9a3570

Please sign in to comment.