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

fix: small fix for dev docker #1786

Merged
merged 14 commits into from
Dec 27, 2023
12 changes: 6 additions & 6 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.231.5/containers/ubuntu/.devcontainer/base.Dockerfile
# See here for image contents: https://github.com/devcontainers/images/blob/main/src/base-ubuntu/.devcontainer/Dockerfile

# [Choice] Ubuntu version (use hirsuite or bionic on local arm64/Apple Silicon): hirsute, focal, bionic
ARG VARIANT="hirsute"
FROM mcr.microsoft.com/vscode/devcontainers/base:0-${VARIANT}
# [Choice] Ubuntu version: https://github.com/devcontainers/images/tree/main/src/base-ubuntu
ARG VARIANT="jammy"
studioj marked this conversation as resolved.
Show resolved Hide resolved
FROM mcr.microsoft.com/vscode/devcontainers/base:${VARIANT}

# [Optional] Uncomment this section to install additional OS packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends \
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends libkrb5-dev
9 changes: 3 additions & 6 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.231.5/containers/ubuntu
// https://mcr.microsoft.com/en-us/product/devcontainers/base/about
{
"name": "Ubuntu",
"build": {
"dockerfile": "Dockerfile",
// Update 'VARIANT' to pick an Ubuntu version: hirsute, focal, bionic
// Use hirsute or bionic on local arm64/Apple Silicon.
// Update 'VARIANT' to pick an Ubuntu version
"args": {
"VARIANT": "focal"
"VARIANT": "ubuntu-22.04"
}
},
// Set *default* container specific settings.json values on container create.
Expand All @@ -30,7 +29,6 @@
"color": "#ff000065"
},
],

"python.defaultInterpreterPath": "/usr/local/python/bin/python",
"mypy-type-checker.args": [
// "--follow-imports=silent",
Expand Down Expand Up @@ -84,7 +82,6 @@
],
}
},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [
// The jira server instance we run via docker is exposed on:
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/post_create.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ else
fi

# Install package in editable mode with test dependencies
pip install -e .[test]
pip install -e .[cli,opt,test]
8 changes: 6 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@

import getpass
import hashlib
import json
import logging
import os
import random
import re
import string
import sys
import time
import unittest
from time import sleep
from typing import Any
Expand Down Expand Up @@ -104,10 +106,11 @@ def hashify(some_string, max_len=8):

def get_unique_project_name():
user = re.sub("[^A-Z_]", "", getpass.getuser().upper())
if "GITHUB_ACTION" in os.environ and "GITHUB_RUN_NUMBER" in os.environ:
if os.getenv("GITHUB_CONTEXT"):
run_number = json.loads(os.getenv("GITHUB_CONTEXT")).get("run_number")
# please note that user underline (_) is not supported by
# Jira even if it is documented as supported.
return "GH" + hashify(user + os.environ["GITHUB_RUN_NUMBER"])
return "GH" + hashify(user + run_number)
identifier = (
user + chr(ord("A") + sys.version_info[0]) + chr(ord("A") + sys.version_info[1])
)
Expand Down Expand Up @@ -259,6 +262,7 @@ def _create_project(
except JIRAError as e:
if "A project with that name already exists" not in str(e):
raise e
time.sleep(1)
return self.jira_admin.project(project_key).id

def create_some_data(self):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def slug(request, cl_admin):

def remove_by_slug():
try:
cl_admin.delete_project(slug)
cl_admin.delete_project(slug, enable_undo=False)
adehad marked this conversation as resolved.
Show resolved Hide resolved
except (ValueError, JIRAError):
# Some tests have project already removed, so we stay silent
pass
Expand Down