From: Michael Tremer Date: Mon, 17 Oct 2022 18:02:53 +0000 (+0000) Subject: packages: Drop properties X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3a8c736a10736ff37ab92f43e27eb25c2ed34543;p=pbs.git packages: Drop properties We probably need something very similar, but we won't need it right now. Signed-off-by: Michael Tremer --- diff --git a/Makefile.am b/Makefile.am index 0fdf6403..47267050 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 diff --git a/src/buildservice/packages.py b/src/buildservice/packages.py index 6baa8fc2..b8307dfd 100644 --- a/src/buildservice/packages.py +++ b/src/buildservice/packages.py @@ -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): diff --git a/src/database.sql b/src/database.sql index a0bf1d96..0e9eda28 100644 --- a/src/database.sql +++ b/src/database.sql @@ -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 index e95b288c..00000000 --- a/src/templates/package-properties.html +++ /dev/null @@ -1,89 +0,0 @@ -{% extends "base.html" %} - -{% block title %}{{ _("Package") }} {{ pkg.name }}{% end block %} - -{% block body %} - - - {% module BuildHeadline(build, shorter=True) %} - -
-
-
- {% raw xsrf_form_html() %} - -
- {{ _("Maintainers") }} - -
- -
- {{ _("Default priority") }} -

- {{ _("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.") }} -

-

- {{ _("You may set a default priority for all builds of this package.") }} -

- -
- -
- -
-
-
- -
- {{ _("Critical path") }} -

- {{ _("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.") }} -

-

- {{ _("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.") }} - {{ _("Learn more.") }} -

-
- -
- - {{ _("Cancel") }} -
-
-
-
-{% end block %} diff --git a/src/web/__init__.py b/src/web/__init__.py index 1fcb3077..c112b68d 100644 --- a/src/web/__init__.py +++ b/src/web/__init__.py @@ -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), diff --git a/src/web/packages.py b/src/web/packages.py index 0619fc01..e5368cd8 100644 --- a/src/web/packages.py +++ b/src/web/packages.py @@ -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)