display warning message when find project name is default
add a new tmpl file for warning message
get stage for current page instead of from env
make sure check stage in current landing page
updated warning message
add null check for existing_stage_identifier
MODIFY
deploy-board/deploy_board/settings.py
deploy-board/deploy_board/settings.py
@@ -231,6 +231,8 @@ TELETRAAN_REDIRECT_CREATE_ENV_PAGE_URL = os.getenv("TELETRAAN_REDIRECT_CREATE_EN
IS_DURING_CODE_FREEZE = True if os.getenv("TELETRAAN_CODE_FREEZE", "false") == "true" else False
TELETRAAN_CODE_FREEZE_URL = os.getenv("TELETRAAN_CODE_FREEZE_URL", None)
TELETRAAN_JIRA_SOURCE_URL = os.getenv("TELETRAAN_JIRA_SOURCE_URL", None)
+TELETRAAN_TRANSFER_OWNERSHIP_URL = os.getenv("TELETRAAN_TRANSFER_OWNERSHIP_URL", None)
+TELETRAAN_RESOURCE_OWNERSHIP_WIKI_URL = os.getenv("TELETRAAN_RESOURCE_OWNERSHIP_WIKI_URL", None)
# use Rodimus if present
RODIMUS_SERVICE_URL = os.getenv("RODIMUS_SERVICE_URL", None)

ADD
deploy-board/deploy_board/templates/deploys/warning_no_nimbus_project_no_deploy.tmpl
+{% load utils %}
+{% load static %}
+
+ <div id="noProjectNoDeployAlert" class="alert alert-danger" role="alert" align="center" style="{{ hidden }}">
+ <a href="#" class="close" data-dismiss="alert">&times;</a>
+ <i><b style="font-size:24px;">No owner, no deploys</b></i>
+ <p>This teletraan stage does not belong to a project.</p>
+ <p>By February 26th, we will disable all deploys for any stages not owned by a project.</p>
+ <p>You can claim a stage <a href="{{transfer_ownership_url}}" target="_blank" rel="noopener">here</a>.
+ <p>Visit <a href="{{resource_ownership_wiki_url}}" target="_blank" rel="noopener">here</a> for more info. Thank you!</p>
+
+ </div>
+
+<script>
+
+ function closeBanner() {
+ document.getElementById("noProjectNoDeployAlert").remove();
+ }
+</script>

MODIFY
deploy-board/deploy_board/templates/environs/env_landing.html
deploy-board/deploy_board/templates/environs/env_landing.html
{% endif %}
{% endif %}
+{% if project_name_is_default %}
+ {% include "deploys/warning_no_nimbus_project_no_deploy.tmpl" %}
+{% endif %}
{% if request_feedback %}
{% include "feedbacks/feedback_banner.tmpl" %}

MODIFY
deploy-board/deploy_board/webapp/env_views.py
deploy-board/deploy_board/webapp/env_views.py
@@ -23,7 +23,7 @@ from django.http import HttpResponse
from django.contrib import messages
from deploy_board.settings import IS_PINTEREST
from deploy_board.settings import TELETRAAN_DISABLE_CREATE_ENV_PAGE, TELETRAAN_REDIRECT_CREATE_ENV_PAGE_URL,\
- IS_DURING_CODE_FREEZE, TELETRAAN_CODE_FREEZE_URL, TELETRAAN_JIRA_SOURCE_URL
+ IS_DURING_CODE_FREEZE, TELETRAAN_CODE_FREEZE_URL, TELETRAAN_JIRA_SOURCE_URL, TELETRAAN_TRANSFER_OWNERSHIP_URL,TELETRAAN_RESOURCE_OWNERSHIP_WIKI_URL
from deploy_board.settings import DISPLAY_STOPPING_HOSTS
from deploy_board.settings import GUINEA_PIG_ENVS
from deploy_board.settings import KAFKA_LOGGING_ADD_ON_ENVS
@@ -324,6 +324,18 @@ class EnvLandingView(View):
env_tag = tags_helper.get_latest_by_targe_id(request, env['id'])
basic_cluster_info = None
capacity_info = {'groups': groups}
+
+ project_name_is_default = False
+ stage_with_external_id = None
+ for env_stage in envs:
+ if env_stage['externalId'] is not None and env_stage['stageName'] == stage:
+ stage_with_external_id = env_stage
+ break
+
+ if stage_with_external_id is not None and stage_with_external_id['externalId'] is not None:
+ existing_stage_identifier = environs_helper.get_nimbus_identifier(stage_with_external_id['externalId'])
+ project_name_is_default = True if existing_stage_identifier is not None and existing_stage_identifier['projectName'] == "default" else False
+
if IS_PINTEREST:
basic_cluster_info = clusters_helper.get_cluster(request, env.get('clusterName'))
capacity_info['cluster'] = basic_cluster_info
@@ -355,6 +367,7 @@ class EnvLandingView(View):
"pinterest": IS_PINTEREST,
"csrf_token": get_token(request),
"display_stopping_hosts": DISPLAY_STOPPING_HOSTS,
+ "project_name_is_default": project_name_is_default,
})
showMode = 'complete'
sortByStatus = 'true'
@@ -388,6 +401,7 @@ class EnvLandingView(View):
"env_tag": env_tag,
"pinterest": IS_PINTEREST,
"display_stopping_hosts": DISPLAY_STOPPING_HOSTS,
+ "project_name_is_default": project_name_is_default,
}
sortByTag = request.GET.get('sortByTag', None)
if sortByTag:

MODIFY
deploy-board/deploy_board/webapp/helpers/environs_helper.py
deploy-board/deploy_board/webapp/helpers/environs_helper.py
"""Collection of all environs related calls
"""
from deploy_board.webapp.helpers.deployclient import DeployClient
-from deploy_board.settings import IS_PINTEREST
+from deploy_board.settings import IS_PINTEREST, TELETRAAN_TRANSFER_OWNERSHIP_URL, TELETRAAN_RESOURCE_OWNERSHIP_WIKI_URL
DEFAULT_ENV_SIZE = 30

display warning message when find project name is default (#636)

add a new tmpl file for warning message

get stage for current page instead of from env

make sure check stage in current landing page

updated warning message

add null check for existing_stage_identifier