Skip to content

Commit

Permalink
Move bodhi-server in its own directory
Browse files Browse the repository at this point in the history
Signed-off-by: Aurélien Bompard <aurelien@bompard.org>
  • Loading branch information
abompard authored and mergify[bot] committed Jan 27, 2022
1 parent 64ed2cb commit de676f8
Show file tree
Hide file tree
Showing 311 changed files with 620 additions and 220 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*.egg*
*.pyc
*.pyo
*.sqlite
bodhi-server/*.sqlite
*.swo
*.swp
.bodhi.tmp
Expand Down
344 changes: 344 additions & 0 deletions bodhi-server/COPYING

Large diffs are not rendered by default.

6 changes: 2 additions & 4 deletions SERVER_MANIFEST.in → bodhi-server/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
include *.txt *.ini *.cfg *.rst README.rst
recursive-include bodhi *.ico *.png *.css *.gif *.jpg *.pt *.txt *.mak *.mako *.js *.html *.xml *.ttf *.woff *.woff2 *.eot *.otf *.svg *.tpl
include *.txt *.ini *.cfg *.rst
recursive-include bodhi *.ico *.png *.css *.gif *.jpg *.pt *.txt *.mak *.mako *.js *.html *.xml *.ttf *.woff *.woff2 *.eot *.otf *.svg *.tpl *.rst
recursive-include apache *
recursive-include alembic *.py *.mako *.rst
recursive-include tools *
include bodhi/server/locale/.placeholder
include COPYING
51 changes: 51 additions & 0 deletions bodhi-server/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
=====
Bodhi
=====

Welcome to Bodhi, Fedora's update gating system.

Bodhi is designed to democratize the package update testing and release process for RPM based Linux
distributions. It provides an interface for developers to propose updates to a distribution, and an
interface for testers to leave feedback about updates through a +1/-1 karma system.

Bodhi’s main features are:


- Provides an interface for developers and release engineers to manage pushing out package updates
for multiple distribution versions.
- Generates pre-release test repositories for end users and testers to install proposed updates.
- Gives testers an interface to leave feedback about package updates, leading to higher quality
package updates.
- Announces the arrival of new packages entering the collection.
- Publishes end-user release notes known as errata.
- Generates yum repositories.
- Queries ResultsDB for automated test results and displays them on updates.



Documentation
=============

You can read Bodhi's
`release notes <https://bodhi.fedoraproject.org/docs/user/release_notes.html>`_
and documentation
`online <https://bodhi.fedoraproject.org/docs>`_, or by installing it on your
Fedora system and pointing your browser at
``/usr/share/doc/bodhi-docs/html/index.html``::

$ sudo dnf install bodhi-docs && firefox /usr/share/doc/bodhi-docs/html/index.html

If you are interested in contributing to Bodhi, you can read the
`developer documentation`_.

.. _developer documentation: https://bodhi.fedoraproject.org/docs/developer/index.html


IRC
===

Come join us on `Libera <https://www.libera.chat/>`_! We've got two channels:

* #bodhi - We use this channel to discuss upstream bodhi development
* #fedora-apps - We use this channel to discuss Fedora's Bodhi deployment (it is more generally
about all of Fedora's infrastructure applications.)
2 changes: 1 addition & 1 deletion alembic.ini → bodhi-server/alembic.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[alembic]
# path to migration scripts
script_location = bodhi:server/migrations
script_location = bodhi.server:migrations

# template used to generate migration files
# file_template = %%(rev)s_%%(slug)s
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@
from bodhi.server.config import config as bodhi_config


__version__ = "5.7.4"

# This is a regular expression used to match username mentions in comments.
MENTION_RE = r'(?<!\S)(@\w+)'

log = python_logging.getLogger(__name__)


Expand Down Expand Up @@ -273,15 +278,15 @@ def main(global_config, testing=None, session=None, **settings):

# Templating
config.add_mako_renderer('.html', settings_prefix='mako.')
config.add_static_view(f'static/v{pkg_resources.get_distribution("bodhi").version}',
'bodhi:server/static')
config.add_static_view(f'static/v{pkg_resources.get_distribution("bodhi-server").version}',
'bodhi.server:static')

from bodhi.server.renderers import rss
config.add_renderer('rss', rss)
config.add_renderer('jsonp', JSONP(param_name='callback'))

# i18n
config.add_translation_dirs('bodhi:server/locale/')
config.add_translation_dirs('bodhi.server:locale/')

# Authentication & Authorization
if testing:
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -438,10 +438,10 @@ class BodhiConfig(dict):
'value': True,
'validator': bool},
'mail.templates_basepath': {
'value': 'bodhi:server/email/templates/',
'value': 'bodhi.server:email/templates/',
'validator': str},
'mako.directories': {
'value': 'bodhi:server/templates',
'value': 'bodhi.server:templates',
'validator': str},
'mandatory_packager_groups': {
'value': ['packager'],
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import markdown.util
import pyramid.threadlocal

from bodhi import MENTION_RE
from bodhi.server import MENTION_RE
from bodhi.server.config import config

if typing.TYPE_CHECKING: # pragma: no cover
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<!-- Only allow websockets connections to fedoraproject.org. -->
<meta http-equiv="Content-Security-Policy" content="connect-src ${request.registry.settings['cors_connect_src']}">

<link rel="shortcut icon" href="${request.static_url('bodhi:server/static/ico/favicon.ico')}">
<link rel="shortcut icon" href="${request.static_url('bodhi.server:static/ico/favicon.ico')}">

<base href="${request.registry.settings['base_address']}"/>
<title>
Expand All @@ -29,12 +29,12 @@
</title>

<%block name="css">
<link href="${request.static_url('bodhi:server/static/vendor/fedora-bootstrap/fedora-bootstrap.min.css') }" rel="stylesheet" />
<link href="${request.static_url('bodhi:server/static/fonts/open-sans.css') }" rel="stylesheet" />
<link href="${request.static_url('bodhi:server/static/fonts/hack.css') }" rel="stylesheet" />
<link href="${request.static_url('bodhi:server/static/fonts/font-awesome.css') }" rel="stylesheet" />
<link href="${request.static_url('bodhi:server/static/vendor/jquery-typeahead/jquery.typeahead.min.css') }" rel="stylesheet" />
<link href="${request.static_url('bodhi:server/static/css/site.css') }" rel="stylesheet" />
<link href="${request.static_url('bodhi.server:static/vendor/fedora-bootstrap/fedora-bootstrap.min.css') }" rel="stylesheet" />
<link href="${request.static_url('bodhi.server:static/fonts/open-sans.css') }" rel="stylesheet" />
<link href="${request.static_url('bodhi.server:static/fonts/hack.css') }" rel="stylesheet" />
<link href="${request.static_url('bodhi.server:static/fonts/font-awesome.css') }" rel="stylesheet" />
<link href="${request.static_url('bodhi.server:static/vendor/jquery-typeahead/jquery.typeahead.min.css') }" rel="stylesheet" />
<link href="${request.static_url('bodhi.server:static/css/site.css') }" rel="stylesheet" />
</%block>

</head>
Expand All @@ -49,7 +49,7 @@
</button>

<a class="navbar-brand" href="${request.route_url('home')}">
<img src="${request.static_url('bodhi:server/static/img/bodhi-logo.png')}" alt="Fedora Update System" height="40">
<img src="${request.static_url('bodhi.server:static/img/bodhi-logo.png')}" alt="Fedora Update System" height="40">
</a>

<div id="bodhi-navbar" class="navbar-collapse collapse">
Expand Down Expand Up @@ -198,16 +198,16 @@ <h5 class="modal-title" id="alertModalLabel">Internal Server Error!</h5>
};
</script>
<%block name="javascript">
<script src="${request.static_url('bodhi:server/static/vendor/jquery/jquery-1.10.2.min.js')}"></script>
<script src="${request.static_url('bodhi.server:static/vendor/jquery/jquery-1.10.2.min.js')}"></script>
<script>
$('#alertModal').on('hidden.bs.modal', function (e) {
document.location.href = document.baseURI;
})
</script>
<script src="${request.static_url('bodhi:server/static/vendor/fedora-bootstrap/fedora-bootstrap.min.js')}"></script>
<script src="${request.static_url('bodhi:server/static/js/site.js')}"></script>
<script src="${request.static_url('bodhi:server/static/vendor/jquery-typeahead/jquery.typeahead.min.js')}"></script>
<script src="${request.static_url('bodhi:server/static/js/search.js')}"></script>
<script src="${request.static_url('bodhi.server:static/vendor/fedora-bootstrap/fedora-bootstrap.min.js')}"></script>
<script src="${request.static_url('bodhi.server:static/js/site.js')}"></script>
<script src="${request.static_url('bodhi.server:static/vendor/jquery-typeahead/jquery.typeahead.min.js')}"></script>
<script src="${request.static_url('bodhi.server:static/js/search.js')}"></script>
</%block>

</body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

<%block name="css">
${parent.css()}
<link href="${request.static_url('bodhi:server/static/vendor/messenger/css/messenger.css') }" rel="stylesheet" />
<link href="${request.static_url('bodhi:server/static/vendor/messenger/css/messenger-theme-flat.css') }" rel="stylesheet" />
<link href="${request.static_url('bodhi:server/static/vendor/selectize/selectize.bootstrap3-0.12.3.css') }" rel="stylesheet" />
<link href="${request.static_url('bodhi.server:static/vendor/messenger/css/messenger.css') }" rel="stylesheet" />
<link href="${request.static_url('bodhi.server:static/vendor/messenger/css/messenger-theme-flat.css') }" rel="stylesheet" />
<link href="${request.static_url('bodhi.server:static/vendor/selectize/selectize.bootstrap3-0.12.3.css') }" rel="stylesheet" />
</%block>

<div class="subheader">
Expand Down Expand Up @@ -381,16 +381,16 @@ <h6 class="font-weight-bold" title="This is the number of days an update needs t
</div></div></div>
<%block name="javascript">
${parent.javascript()}
<script src="${request.static_url('bodhi:server/static/vendor/selectize/selectize-0.12.3.min.js')}"></script>
<script src="${request.static_url('bodhi.server:static/vendor/selectize/selectize-0.12.3.min.js')}"></script>
% if update and update.from_tag:
<script>var existing_sidetag_update = true;</script>
% else:
<script>var existing_sidetag_update = false;</script>
% endif
<script src="${request.static_url('bodhi:server/static/vendor/messenger/js/messenger.min.js')}"></script>
<script src="${request.static_url('bodhi:server/static/vendor/messenger/js/messenger-theme-flat.js')}"></script>
<script src="${request.static_url('bodhi:server/static/js/forms.js')}"></script>
<script src="${request.static_url('bodhi:server/static/js/update_form.js')}"></script>
<script src="${request.static_url('bodhi.server:static/vendor/messenger/js/messenger.min.js')}"></script>
<script src="${request.static_url('bodhi.server:static/vendor/messenger/js/messenger-theme-flat.js')}"></script>
<script src="${request.static_url('bodhi.server:static/js/forms.js')}"></script>
<script src="${request.static_url('bodhi.server:static/js/update_form.js')}"></script>

<script>$("#js-warning").hide();$("#new-update-form").show();</script>
<script> $(document).ready(function() { $('.panel-heading > span, dt').tooltip(); }); </script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

<%block name="css">
${parent.css()}
<link href="${request.static_url('bodhi:server/static/vendor/messenger/css/messenger.css') }" rel="stylesheet" />
<link href="${request.static_url('bodhi:server/static/vendor/messenger/css/messenger-theme-flat.css') }" rel="stylesheet" />
<link href="${request.static_url('bodhi.server:static/vendor/messenger/css/messenger.css') }" rel="stylesheet" />
<link href="${request.static_url('bodhi.server:static/vendor/messenger/css/messenger-theme-flat.css') }" rel="stylesheet" />
</%block>
<div class="subheader">
<div class="container py-4">
Expand Down Expand Up @@ -225,9 +225,9 @@ <h5 class="font-weight-bold d-flex align-items-center">

<%block name="javascript">
${parent.javascript()}
<script src="${request.static_url('bodhi:server/static/vendor/messenger/js/messenger.min.js')}"></script>
<script src="${request.static_url('bodhi:server/static/vendor/messenger/js/messenger-theme-flat.js')}"></script>
<script src="${request.static_url('bodhi:server/static/js/forms.js')}"></script>
<script src="${request.static_url('bodhi:server/static/js/override_form.js')}"></script>
<script src="${request.static_url('bodhi.server:static/vendor/messenger/js/messenger.min.js')}"></script>
<script src="${request.static_url('bodhi.server:static/vendor/messenger/js/messenger-theme-flat.js')}"></script>
<script src="${request.static_url('bodhi.server:static/js/forms.js')}"></script>
<script src="${request.static_url('bodhi.server:static/js/override_form.js')}"></script>
<script>$("#js-warning").hide();</script>
</%block>
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
% if chrome:
<%block name="css">
${parent.css()}
<link href="${request.static_url('bodhi:server/static/vendor/selectize/selectize.bootstrap3-0.12.3.css') }" rel="stylesheet" />
<link href="${request.static_url('bodhi.server:static/vendor/selectize/selectize.bootstrap3-0.12.3.css') }" rel="stylesheet" />
<link rel="alternate" type="application/atom+xml" title="New Buildroot Overrides" href="${request.route_url('overrides_rss') + '?' + request.query_string}"/>
</%block>
% endif
Expand Down Expand Up @@ -188,7 +188,7 @@ <h3 class="font-weight-bold m-0 d-flex align-items-center">Overrides
% if chrome:
<%block name="javascript">
${parent.javascript()}
<script src="${request.static_url('bodhi:server/static/vendor/selectize/selectize-0.12.3.min.js')}"></script>
<script src="${request.static_url('bodhi.server:static/vendor/selectize/selectize-0.12.3.min.js')}"></script>
<script>
$(document).ready(function() {

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<%inherit file="master.html"/>
<%block name="css">
${parent.css()}
<link href="${request.static_url('bodhi:server/static/vendor/chartjs/Chart.min.css')}" rel="stylesheet" />
<link href="${request.static_url('bodhi.server:static/vendor/chartjs/Chart.min.css')}" rel="stylesheet" />
</%block>
<div class="subheader">
<div class="container py-4">
Expand Down Expand Up @@ -216,7 +216,7 @@ <h3 class="font-weight-bold m-0"><a href="${request.route_url('releases')}">Rele

<%block name="javascript">
${parent.javascript()}
<script src="${request.static_url('bodhi:server/static/vendor/chartjs/Chart.min.js')}"></script>
<script src="${request.static_url('bodhi.server:static/vendor/chartjs/Chart.min.js')}"></script>

<script type="text/javascript">
$(document).ready(function() {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
<%block name="css">
${parent.css()}
<link rel="alternate" type="application/atom+xml" title="New Comments on ${update.alias}" href="${request.route_url('comments_rss')}?updates=${update.alias}"/>
<link href="${request.static_url('bodhi:server/static/vendor/messenger/css/messenger.css') }" rel="stylesheet" />
<link href="${request.static_url('bodhi:server/static/vendor/messenger/css/messenger-theme-flat.css') }" rel="stylesheet" />
<link href="${request.static_url('bodhi.server:static/vendor/messenger/css/messenger.css') }" rel="stylesheet" />
<link href="${request.static_url('bodhi.server:static/vendor/messenger/css/messenger-theme-flat.css') }" rel="stylesheet" />
</%block>

<%
Expand Down Expand Up @@ -717,11 +717,11 @@ <h3 class="modal-title" id="waiveModalLabel">Trigger Tests</h3>

<%block name="javascript">
${parent.javascript()}
<script src="${request.static_url('bodhi:server/static/vendor/messenger/js/messenger.min.js')}"></script>
<script src="${request.static_url('bodhi:server/static/vendor/messenger/js/messenger-theme-flat.js')}"></script>
<script src="${request.static_url('bodhi:server/static/js/forms.js')}"></script>
<script src="${request.static_url('bodhi:server/static/js/comment_form.js')}"></script>
<script src="${request.static_url('bodhi:server/static/vendor/moment/moment.min.js')}"></script>
<script src="${request.static_url('bodhi.server:static/vendor/messenger/js/messenger.min.js')}"></script>
<script src="${request.static_url('bodhi.server:static/vendor/messenger/js/messenger-theme-flat.js')}"></script>
<script src="${request.static_url('bodhi.server:static/js/forms.js')}"></script>
<script src="${request.static_url('bodhi.server:static/js/comment_form.js')}"></script>
<script src="${request.static_url('bodhi.server:static/vendor/moment/moment.min.js')}"></script>
<script>
$(document).ready(function() {
// Some handy lookups that map taskotron states to bootstrap CSS classes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
% if chrome:
<%block name="css">
${parent.css()}
<link href="${request.static_url('bodhi:server/static/vendor/selectize/selectize.bootstrap3-0.12.3.css') }" rel="stylesheet" />
<link href="${request.static_url('bodhi.server:static/vendor/selectize/selectize.bootstrap3-0.12.3.css') }" rel="stylesheet" />
<link rel="alternate" type="application/atom+xml" title="New Updates" href="${request.route_url('updates_rss') + '?' + request.query_string}"/>
</%block>
<div class="subheader">
Expand Down Expand Up @@ -288,7 +288,7 @@ <h3 class="font-weight-bold m-0 d-flex align-items-center">Updates
% if chrome:
<%block name="javascript">
${parent.javascript()}
<script src="${request.static_url('bodhi:server/static/vendor/selectize/selectize-0.12.3.min.js')}"></script>
<script src="${request.static_url('bodhi.server:static/vendor/selectize/selectize-0.12.3.min.js')}"></script>
<script>
$(document).ready(function() {

Expand Down
File renamed without changes.
7 changes: 4 additions & 3 deletions bodhi/server/util.py → bodhi-server/bodhi/server/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

from collections import defaultdict, OrderedDict
from contextlib import contextmanager
from importlib import import_module
from urllib.parse import urlencode
import errno
import functools
Expand Down Expand Up @@ -456,7 +457,7 @@ def version(context=None):
Returns:
str: The Bodhi server's version.
"""
return pkg_resources.get_distribution('bodhi').version
return pkg_resources.get_distribution('bodhi-server').version


def hostname(context=None):
Expand Down Expand Up @@ -1236,7 +1237,7 @@ def get_absolute_path(location):
"""
Return an absolute path in filesystem for a relative path value.
For example, location 'bodhi:server/templates' can return something like:
For example, location 'bodhi.server:templates' can return something like:
/home/bodhi/bodhi/server/templates/
Args:
Expand All @@ -1245,7 +1246,7 @@ def get_absolute_path(location):
str: An absolute path in the filesystem referencing to the given directory.
"""
module, final = location.split(':')
base = os.path.dirname(__import__(module).__file__)
base = os.path.dirname(import_module(module).__file__)
return base + "/" + final


Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions bodhi-server/production.ini
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ use = egg:bodhi-server
# Where to search for e-mail templates. Each release has a mail_template attribute that defines the
# name of a mail template, and Bodhi will look in the path defined by this setting to find the named
# template.
# mail.templates_basepath = bodhi:server/email/templates/
# mail.templates_basepath = bodhi.server:email/templates/


##
Expand Down Expand Up @@ -523,7 +523,7 @@ debugtoolbar.hosts = 127.0.0.1 ::1
## Templates
##
# Where Bodhi's templates are stored. You likely don't want or need to adjust this setting.
# mako.directories = bodhi:server/templates
# mako.directories = bodhi.server:templates

##
## Authentication & Sessions
Expand Down
3 changes: 3 additions & 0 deletions bodhi-server/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"
Loading

0 comments on commit de676f8

Please sign in to comment.