]> git.ipfire.org Git - pbs.git/commitdiff
packages: Drop properties
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 17 Oct 2022 18:02:53 +0000 (18:02 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 17 Oct 2022 18:02:53 +0000 (18:02 +0000)
We probably need something very similar, but we won't need it right now.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Makefile.am
src/buildservice/packages.py
src/database.sql
src/templates/package-properties.html [deleted file]
src/web/__init__.py
src/web/packages.py

index 0fdf6403c9185551664419604e1618d079347635..472670500d474f8a817d4e23f7d4ecb07e1247f4 100644 (file)
@@ -169,7 +169,6 @@ dist_templates_DATA = \
        src/templates/jobs-buildroot.html \
        src/templates/log.html \
        src/templates/login.html \
-       src/templates/package-properties.html \
        src/templates/queue.html \
        src/templates/search.html \
        src/templates/source-list.html
index 6baa8fc2700ee185eaabd0a95c3898f7fd624e87..b8307dfd55f570debe7916c2c1ec376c3db595b9 100644 (file)
@@ -502,33 +502,6 @@ class Package(base.DataObject):
                """
                return await self.backend.open(self.path)
 
-       ## properties
-
-       def update_property(self, key, value):
-               if self.properties:
-                       self.db.execute("UPDATE packages_properties SET %s = %%s \
-                               WHERE name = %%s" % key, value, self.name)
-               else:
-                       self.db.execute("INSERT INTO packages_properties(name, %s) \
-                               VALUES(%%s, %%s)" % key, self.name, value)
-
-               # Update cache
-               self.properties[key] = value
-
-       @lazy_property
-       def properties(self):
-               res = self.db.get("SELECT * FROM packages_properties WHERE name = %s", self.name)
-
-               ret = {}
-               if res:
-                       for key in res:
-                               if key in ("id", "name"):
-                                       continue
-
-                               ret[key] = res[key]
-
-               return ret
-
 
 class File(base.Object):
        def init(self, package, data):
index a0bf1d96d668ecc01edea578cdaa7f7c450c1cf7..0e9eda28ada2acf70aff51912fd580e2c9df06e6 100644 (file)
@@ -726,36 +726,6 @@ CREATE SEQUENCE public.packages_id_seq
 ALTER SEQUENCE public.packages_id_seq OWNED BY public.packages.id;
 
 
---
--- Name: packages_properties; Type: TABLE; Schema: public; Owner: -
---
-
-CREATE TABLE public.packages_properties (
-    id integer NOT NULL,
-    name text NOT NULL,
-    priority integer DEFAULT 0 NOT NULL
-);
-
-
---
--- Name: packages_properties_id_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE public.packages_properties_id_seq
-    START WITH 1
-    INCREMENT BY 1
-    NO MINVALUE
-    NO MAXVALUE
-    CACHE 1;
-
-
---
--- Name: packages_properties_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
---
-
-ALTER SEQUENCE public.packages_properties_id_seq OWNED BY public.packages_properties.id;
-
-
 --
 -- Name: relation_sizes; Type: VIEW; Schema: public; Owner: -
 --
@@ -1170,13 +1140,6 @@ ALTER TABLE ONLY public.mirrors_checks ALTER COLUMN id SET DEFAULT nextval('publ
 ALTER TABLE ONLY public.packages ALTER COLUMN id SET DEFAULT nextval('public.packages_id_seq'::regclass);
 
 
---
--- Name: packages_properties id; Type: DEFAULT; Schema: public; Owner: -
---
-
-ALTER TABLE ONLY public.packages_properties ALTER COLUMN id SET DEFAULT nextval('public.packages_properties_id_seq'::regclass);
-
-
 --
 -- Name: repositories id; Type: DEFAULT; Schema: public; Owner: -
 --
@@ -1298,14 +1261,6 @@ ALTER TABLE ONLY public.mirrors
     ADD CONSTRAINT idx_2198115_primary PRIMARY KEY (id);
 
 
---
--- Name: packages_properties idx_2198147_primary; Type: CONSTRAINT; Schema: public; Owner: -
---
-
-ALTER TABLE ONLY public.packages_properties
-    ADD CONSTRAINT idx_2198147_primary PRIMARY KEY (id);
-
-
 --
 -- Name: repositories_builds idx_2198189_primary; Type: CONSTRAINT; Schema: public; Owner: -
 --
@@ -1503,13 +1458,6 @@ CREATE UNIQUE INDEX builds_uuid ON public.builds USING btree (uuid) WHERE (delet
 CREATE UNIQUE INDEX distributions_slug ON public.distributions USING btree (slug) WHERE (deleted IS FALSE);
 
 
---
--- Name: idx_2198147_name; Type: INDEX; Schema: public; Owner: -
---
-
-CREATE UNIQUE INDEX idx_2198147_name ON public.packages_properties USING btree (name);
-
-
 --
 -- Name: idx_2198189_build_id; Type: INDEX; Schema: public; Owner: -
 --
diff --git a/src/templates/package-properties.html b/src/templates/package-properties.html
deleted file mode 100644 (file)
index e95b288..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-{% extends "base.html" %}
-
-{% block title %}{{ _("Package") }} {{ pkg.name }}{% end block %}
-
-{% block body %}
-       <ul class="breadcrumb">
-               <li>
-                       <a href="/">{{ _("Home") }}</a>
-                       <span class="divider">/</span>
-               </li>
-               <li>
-                       <a href="/packages">{{ _("Packages") }}</a>
-                       <span class="divider">/</span>
-               </li>
-               <li>
-                       <a href="/package/{{ pkg.name }}">{{ pkg.name }}</a>
-                       <span class="divider">/</span>
-               </li>
-               <li class="active">
-                       <a href="/package/{{ pkg.name }}/properties">{{ _("Properties") }}</a>
-               </li>
-       </ul>
-
-       {% module BuildHeadline(build, shorter=True) %}
-
-       <div class="row">
-               <div class="span8">
-                       <form class="form form-horizontal" method="POST" action="">
-                               {% raw xsrf_form_html() %}
-
-                               <fieldset>
-                                       <legend>{{ _("Maintainers") }}</legend>
-
-                               </fieldset>
-
-                               <fieldset>
-                                       <legend>{{ _("Default priority") }}</legend>
-                                       <p>
-                                               {{ _("A big benefit of the Pakfire Build Service is, that builds are available to end-users in a very short time.") }}
-                                               {{ _("Some packages might need some extra boost if the build servers are very busy.") }}
-                                       </p>
-                                       <p>
-                                               {{ _("You may set a default priority for all builds of this package.") }}
-                                       </p>
-
-                                       <div class="control-group">
-                                               <label class="control-label" for="priority">{{ _("Default priority") }}</label>
-                                               <div class="controls">
-                                                       <select name="priority" id="priority">
-                                                               <option value="2" {% if properties.priority >= 2 %}selected="selected"{% end %}>
-                                                                       {{ _("Very high") }}
-                                                               </option>
-                                                               <option value="1" {% if properties.priority == 1 %}selected="selected"{% end %}>
-                                                                       {{ _("High") }}
-                                                               </option>
-                                                               <option value="0" {% if properties.priority == 0 %}selected="selected"{% end %}>
-                                                                       {{ _("Medium") }}
-                                                               </option>
-                                                               <option value="-1" {% if properties.priority == -1 %}selected="selected"{% end %}>
-                                                                       {{ _("Low") }}
-                                                               </option>
-                                                               <option value="-2" {% if properties.priority <= -2 %}selected="selected"{% end %}>
-                                                                       {{ _("Very low") }}
-                                                               </option>
-                                                       </select>
-                                               </div>
-                                       </div>
-                               </fieldset>
-
-                               <fieldset>
-                                       <legend>{{ _("Critical path") }}</legend>
-                                       <p>
-                                               {{ _("A package that belongs to the critical path is a package that plays a very essential role in the distribution.") }}
-                                               {{ _("If such a package is broken, it may not be possible to boot or recover the system anymore, so we need to be extra sure that these packages work.") }}
-                                       </p>
-                                       <p>
-                                               {{ _("If this package is marked to belong to the critical path, it will need a higher score to pass to the next repository and more.") }}
-                                               <a href="/documents/critical-path">{{ _("Learn more.") }}</a>
-                                       </p>
-                               </fieldset>
-
-                               <div class="form-actions">
-                                       <button type="submit" class="btn btn-primary">{{ _("Save changes") }}</button>
-                                       <a class="btn" href="/package/{{ pkg.name }}">{{ _("Cancel") }}</a>
-                               </div>
-                       </form>
-               </div>
-       </div>
-{% end block %}
index 1fcb3077f52db5801cf3ce1dbbc1c17b4d81573b..c112b68dc1a1d676226d6911fb48800c7433d312 100644 (file)
@@ -127,7 +127,6 @@ class Application(tornado.web.Application):
                                packages.FileDownloadHandler),
                        (r"/package/([\w]{8}-[\w]{4}-[\w]{4}-[\w]{4}-[\w]{12})/view(.*)",
                                packages.FileViewHandler),
-                       (r"/package/([\w\-\+]+)/properties", packages.PackagePropertiesHandler),
 
                        # Files
                        (r"/file/([\w]{8}-[\w]{4}-[\w]{4}-[\w]{4}-[\w]{12})", FileDetailHandler),
index 0619fc01689db381f341adcdf6d3650c35f49dd4..e5368cd8d2de7af992a6b0fc5a42750c4bcbe8c1 100644 (file)
@@ -46,35 +46,6 @@ class ShowHandler(base.BaseHandler):
                self.render("packages/show.html", package=package)
 
 
-class PackagePropertiesHandler(base.BaseHandler):
-       @tornado.web.authenticated
-       def get(self, name):
-               build = self.backend.builds.get_latest_by_name(name)
-
-               if not build:
-                       raise tornado.web.HTTPError(404, "Package '%s' was not found" % name)
-
-               # Check if the user has sufficient permissions.
-               if not build.has_perm(self.current_user):
-                       raise tornado.web.HTTPError(403, "User %s is not allowed to manage build %s" \
-                               % (self.current_user, build))
-
-               self.render("package-properties.html", build=build,
-                       pkg=build.pkg, properties=build.pkg.properties)
-
-       @tornado.web.authenticated
-       def post(self, name):
-               build = self.backend.builds.get_latest_by_name(name)
-
-               if not build:
-                       raise tornado.web.HTTPError(404, "Package '%s' was not found" % name)
-
-               # Check if the user has sufficient permissions.
-               if not build.has_perm(self.current_user):
-                       raise tornado.web.HTTPError(403, "User %s is not allowed to manage build %s" \
-                               % (self.current_user, build))
-
-
 class FileDownloadHandler(base.BaseHandler):
        async def get(self, uuid, path):
                package = self.backend.packages.get_by_uuid(uuid)