FreshPorts / freshports

The website part of FreshPorts
http://www.freshports.org/
BSD 2-Clause "Simplified" License
70 stars 24 forks source link

If a vuxml entry has zero entries in commit_log_ports_vuxml that's an error #87

Open dlangille opened 6 years ago

dlangille commented 6 years ago

If there are no entries in commit_log_ports_vuxml then the name in the vuxml entry is probably wrong.

Case in point: https://svnweb.freebsd.org/ports/head/security/vuxml/vuln.xml?r1=477823&r2=477822&pathrev=477823

There is no current port with package name = phpmyadmin

But we do have these values in other branches:

freshports.dev=# select package_name, element_pathname(element_id) from ports_active where name = 'phpmyadmin';
   package_name   |              element_pathname               
------------------+---------------------------------------------
 phpMyAdmin-php56 | /ports/head/databases/phpmyadmin
 phpMyAdmin       | /ports/branches/2016Q4/databases/phpmyadmin
 phpMyAdmin       | /ports/branches/2017Q1/databases/phpmyadmin
 phpMyAdmin       | /ports/branches/2018Q1/databases/phpmyadmin
 phpMyAdmin-php56 | /ports/branches/2018Q2/databases/phpmyadmin
(5 rows)

Which makes me think we need to record PKGNAME with each row in commit_log_ports for historical searching such as this. Wow, that's big rabbit hole.

dlangille commented 6 years ago

With recent work on CONFLICTS, we are storing PKGNAME, well, as part of port_name_revision

freshports.stage=# \d commit_log_ports
                Table "public.commit_log_ports"
       Column       |   Type   | Collation | Nullable | Default 
--------------------+----------+-----------+----------+---------
 commit_log_id      | integer  |           | not null | 
 port_id            | integer  |           | not null | 
 needs_refresh      | smallint |           | not null | 
 port_version       | text     |           |          | 
 port_revision      | text     |           |          | 
 port_epoch         | text     |           |          | 
 port_name_revision | text     |           |          | 
Indexes:
    "commit_log_ports_pkey" PRIMARY KEY, btree (commit_log_id, port_id)
    "commit_log_ports_needs_refresh_idx" btree (needs_refresh) WHERE needs_refresh <> 0
    "commit_log_ports_port_id" btree (port_id)
    "needs_refresh" btree (needs_refresh)
Foreign-key constraints:
    "$1" FOREIGN KEY (commit_log_id) REFERENCES commit_log(id) ON UPDATE CASCADE ON DELETE CASCADE
    "$2" FOREIGN KEY (port_id) REFERENCES ports(id) ON UPDATE CASCADE ON DELETE CASCADE
Triggers:
    commit_log_ports_insert AFTER INSERT ON commit_log_ports FOR EACH ROW EXECUTE PROCEDURE commit_log_ports_insert()

freshports.stage=#