Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more info to OT requests admin page #4423

Merged
merged 1 commit into from
Oct 3, 2024
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
20 changes: 16 additions & 4 deletions pages/ot_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@
from google.cloud import ndb

from api.converters import stage_to_json_dict
from internals.core_enums import OT_EXTENSION_STAGE_TYPES, OT_READY_FOR_CREATION
from internals.core_enums import (
OT_EXTENSION_STAGE_TYPES,
OT_READY_FOR_CREATION,
OT_CREATED,
OT_CREATION_FAILED,
OT_ACTIVATION_FAILED)
from internals.core_models import Stage

from framework import basehandlers
Expand All @@ -32,13 +37,15 @@ def get_template_data(self, **kwargs):
stages_with_requests = Stage.query(
ndb.OR(Stage.ot_action_requested == True,
Stage.ot_setup_status == OT_READY_FOR_CREATION)).fetch()
stages_with_failures = Stage.query(
ndb.OR(Stage.ot_setup_status == OT_ACTIVATION_FAILED,
Stage.ot_setup_status == OT_CREATION_FAILED)).fetch()
stages_awaiting_activation = Stage.query(
Stage.ot_setup_status == OT_CREATED).fetch()
creation_stages = []
extension_stages = []
for stage in stages_with_requests:
stage_dict = stage_to_json_dict(stage)
# Add the request note that is not typically visible to non-admins.
if stage.ot_request_note:
stage_dict['ot_request_note'] = stage.ot_request_note
# Group up creation and extension requests.
if stage_dict['stage_type'] in OT_EXTENSION_STAGE_TYPES:
# Information will be needed from the original OT stage.
Expand All @@ -52,7 +59,12 @@ def get_template_data(self, **kwargs):
else:
creation_stages.append(stage_dict)

failed_stages = [stage_to_json_dict(s) for s in stages_with_failures]
activation_pending_stages = [
stage_to_json_dict(s) for s in stages_awaiting_activation]
return {
'creation_stages': creation_stages,
'extension_stages': extension_stages,
'activation_pending_stages': activation_pending_stages,
'failed_stages': failed_stages,
}
45 changes: 36 additions & 9 deletions templates/admin/features/ot_requests.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<div id="subheader">
<div>
<h2>Origin Trial Requests</h2>
<h2>Origin Trial Requests with errors</h2>
</div>
</div>

Expand All @@ -24,7 +24,7 @@ <h2>Copy row directly into "Trials - Validated" spreadsheet (
</div>
</div>

{% for stage in creation_stages %}
{% for stage in failed_stages %}
<section>
<h3>
Creation request for: {{stage.ot_display_name}}
Expand Down Expand Up @@ -58,18 +58,18 @@ <h3>
</table>
</div>
</section>
<section class="additional-comments">
<h4>Additional comments:</h4>
{{stage.ot_request_note}}
</section>
{% endfor %}
<hr>

<h2>Extensions awaiting initiation</h2>
{% for stage_info in extension_stages %}
<section>
<h3>
Extension request for: {{stage_info.ot_stage.ot_display_name}}
</h3>
<p>Name: {{stage_info.ot_stage.ot_display_name}}</p>
<br>
<p>Origin trial ID: {{stage_info.ot_stage.origin_trial_id}}</p>
<br>
<p>Chromestatus feature ID: {{stage_info.ot_stage.feature_id}}</p>
<br>
<p>Intent to Extend Experiment: {{stage_info.extension_stage.intent_thread_url}}</p>
<br>
<p>New end milestone: {{stage_info.extension_stage.desktop_last}}</p>
Expand All @@ -78,6 +78,33 @@ <h3>
<br>
</section>
{% endfor %}
<hr>

<h2>Origin Trials pending activation</h2>
{% for stage in activation_pending_stages %}
<section>
<p>Name: {{stage.ot_display_name}}</p>
<br>
<p>Origin trial ID: {{stage.origin_trial_id}}</p>
<br>
<p>Chromestatus feature ID: {{stage.feature_id}}</p>
<br>
<p>Activation date: {{stage.ot_activation_date}}</p>
</section>
{% endfor %}
<hr>

<h2>Origin Trials with creation in progress</h2>
{% for stage in creation_stages %}
<section>
<p>Name: {{stage.ot_display_name}}</p>
<br>
<p>Origin trial ID: {{stage.origin_trial_id}}</p>
<br>
<p>Chromestatus feature ID: {{stage.feature_id}}</p>
</section>
{% endfor %}

{% endblock %}

{% block js %}
Expand Down