Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/loopcaptain/board/templates/loop.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h1>{{ view.title }}</h1>
{% if note %}<p class="flash" role="status">{{ note }}</p>{% endif %}
{% if error %}<p class="flash bad" role="alert">{{ error }}</p>{% endif %}
{% if hidden %}<p class="note">Hidden from the first page and its figures. <code>loopcaptain unhide {{ view.repo.path|place }} {{ view.loop_id }}</code> shows it again.</p>{% endif %}
{% if same_id %}<p class="flash warn" role="status">Another watched repository has a loop with this id: {% for key in same_id %}<a href="{{ url_for('loop_page', repo_key=key, loop_id=view.loop_id) }}">{{ key }}</a>{{ ', ' if not loop.last }}{% endfor %}. Check that this is the loop you mean to answer. The board signs each answer for this folder alone, but a loop that still runs an earlier helper also takes lines signed with the key every loop shares: paste the current helper into both.</p>{% endif %}
{% if same_id %}<p class="flash warn" role="status">{% for key in same_id %}<a href="{{ url_for('loop_page', repo_key=key, loop_id=view.loop_id) }}">{{ key }}</a>{{ ', ' if not loop.last }}{% endfor %} also has a loop with this id. Check you are answering the right one.</p>{% endif %}

{% if state.question %}
{% set q = state.question %}
Expand Down
2 changes: 1 addition & 1 deletion src/loopcaptain/board/templates/overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<h1 class="sr">{{ 'Waiting for you' if tab == 'waiting' else 'Loops' }}</h1>
{% if note %}<p class="flash" role="status">{{ note }}</p>{% endif %}
{% if error %}<p class="flash bad" role="alert">{{ error }}</p>{% endif %}
{% if repeated %}<p class="flash warn" role="status">Two watched repositories have a loop with the same id: {% for loop_id, keys in repeated.items() %}<code>{{ loop_id }}</code> in {{ keys[:-1]|join(', ') }} and {{ keys[-1] }}{{ '; ' if not loop.last }}{% endfor %}. Check the repository before you answer; the loop's page says more.</p>{% endif %}
{% if repeated %}<p class="flash warn" role="status">Two watched repositories have a loop with the same id: {% for loop_id, keys in repeated.items() %}<code>{{ loop_id }}</code> in {{ keys[:-1]|join(', ') }} and {{ keys[-1] }}{{ '; ' if not loop.last }}{% endfor %}. Check you are answering the right one.</p>{% endif %}
{% if unreadable %}
<div class="flash bad" role="alert">
<p>Not shown, because the board could not look into {{ 'it' if unreadable|length == 1 else 'them' }}:</p>
Expand Down
9 changes: 5 additions & 4 deletions tests/test_repeated_ids.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,14 @@ def test_the_loop_page_names_the_other_repository_with_the_same_id(
page = client.get("/loop/alpha-repo/scan").text
other = client.get("/loop/alpha-repo/other").text

assert "Another watched repository has a loop with this id:" in page
assert 'href="http://board.test/loop/beta-repo/scan">beta-repo</a>' in page
assert "Another watched repository" not in other
assert 'href="http://board.test/loop/beta-repo/scan">beta-repo</a> also has a loop with this id.' in page
assert "Check you are answering the right one." in page
assert "helper" not in page.split("flash warn", 1)[1].split("</p>", 1)[0]
assert "also has a loop with this id" not in other


def test_no_warning_where_every_id_is_its_own(tmp_path: Path, helper: types.ModuleType) -> None:
client = board(two_repos(tmp_path, helper, "scan-two"), tmp_path / "s")

assert "the same id" not in client.get("/").text
assert "Another watched repository" not in client.get("/loop/alpha-repo/scan").text
assert "also has a loop with this id" not in client.get("/loop/alpha-repo/scan").text
Loading