Skip to content

Commit

Permalink
Merge pull request #3083 from ansible/devel
Browse files Browse the repository at this point in the history
apply recent changes from devel

* add alisonlhart to namespace requests
* Merge pull request #2784 from ansible/add-alison 
* Handle role repositories that do not have a provider_namespace.namesp… 
* Initial CI implementation with github actions (#3065)
  • Loading branch information
jctanner authored Jan 12, 2023
2 parents 37b3cf7 + 360fab7 commit d70755f
Show file tree
Hide file tree
Showing 6 changed files with 110 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/New_namespace.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Request a Namespace
about: Request a new namespace for one of your GitHub Orgs
title: 'namespace: FIXME'
labels: area/namespace
assignees: JohnLieske, thedoubl3j
assignees: JohnLieske, thedoubl3j, alisonlhart

---

Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/ci_lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
name: Lint
on:
pull_request:
branches:
- '**'
paths-ignore:
- 'docs/**'
push:
branches:
- '**'
workflow_dispatch:

jobs:

linters:

# https://github.com/actions/setup-python/issues/355#issuecomment-1335042510
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2

- uses: actions/setup-python@v2
with:
python-version: "3.6"

# https://stackoverflow.com/a/72611356
- name: downgrade setuptools
run: pip install setuptools~=57.5.0

- name: install requirements
run: pip install -r requirements/dev-requirements.txt

- name: python lint
run: make test/flake8

- name: yaml lint
run: make test/yamllint
45 changes: 45 additions & 0 deletions .github/workflows/ci_unit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
name: Unit
on:
pull_request:
branches:
- '**'
paths-ignore:
- 'docs/**'
push:
branches:
- '**'
workflow_dispatch:

jobs:

pytest:

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: actions/setup-python@v2
with:
python-version: "3.10"

# - name: Update apt
# run: sudo apt -y update

# - name: Install LDAP requirements
# run: sudo apt-get install -y libsasl2-dev python3 libldap2-dev libssl-dev build-essential

- name: Install docker-compose
run: pip3 install --upgrade docker-compose

- name: build the image
run: make dev/build

- name: start the containers
run: make dev/up_detached

- name: wait for stack to settle
run: sleep 360

- name: start the tests
run: make dev/test
1 change: 1 addition & 0 deletions .yamllint
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ ignore: |

rules:
line-length: disable
truthy: disable
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ dev/test:
# Other option are:
# - install side packages globally or
# - call tools using python api instead of shell commands.
@$(DOCKER_COMPOSE) exec galaxy bash -c '\
@$(DOCKER_COMPOSE) exec -T galaxy bash -c '\
source $(GALAXY_VENV)/bin/activate; \
export DJANGO_SETTINGS_MODULE=galaxy.settings.testing; \
pytest galaxy \
Expand Down
32 changes: 23 additions & 9 deletions galaxy/api/serializers/roles.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,29 @@ def get_summary_fields(self, obj):
name=obj.content_type.name,
description=obj.content_type.description)
d['dependencies'] = [str(g) for g in obj.dependencies.all()]
d['namespace'] = dict(
id=obj.repository.provider_namespace.namespace.pk,
name=obj.repository.provider_namespace.namespace.name,
avatar_url=obj.repository.provider_namespace.namespace.avatar_url,
location=obj.repository.provider_namespace.namespace.location,
company=obj.repository.provider_namespace.namespace.company,
email=obj.repository.provider_namespace.namespace.email,
html_url=obj.repository.provider_namespace.namespace.html_url,
is_vendor=obj.repository.provider_namespace.namespace.is_vendor)
if obj.repository.provider_namespace.namespace is not None:
a_url = obj.repository.provider_namespace.namespace.avatar_url,
d['namespace'] = dict(
id=obj.repository.provider_namespace.namespace.pk,
name=obj.repository.provider_namespace.namespace.name,
avatar_url=a_url,
location=obj.repository.provider_namespace.namespace.location,
company=obj.repository.provider_namespace.namespace.company,
email=obj.repository.provider_namespace.namespace.email,
html_url=obj.repository.provider_namespace.namespace.html_url,
is_vendor=obj.repository.provider_namespace.namespace.is_vendor
)
else:
d['namespace'] = dict(
id=None,
name=None,
avatar_url=None,
location=None,
company=None,
email=None,
html_url=None,
is_vendor=None
)
d['platforms'] = [
dict(name=g.name, release=g.release) for g in obj.platforms.all()]
d['provider_namespace'] = dict(
Expand Down

0 comments on commit d70755f

Please sign in to comment.