Add a function to insert a release from the ftpscrapper cron job

RESOLVED WONTFIX

Status

RESOLVED WONTFIX
6 years ago
a year ago

People

(Reporter: adrian, Unassigned)

Tracking

unspecified
Future

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

6 years ago
We tried to use the same function to add a release from the UI and from the ftpscrapper, but it's just too different to work, so we will need to have two functions, taking different parameters and raising different errors. 

The current add_new_release function works fine for the UI, except: 
- it should insert a release name and not a product name into releases_raw
- the ignore_duplicates parameter is useless
- the update_product should be true by default, we want to update every time we add a release from the UI

The new function (to be used by the ftpscrapper) should behave the same but:
- it takes a release name as parameter (as opposed to a product name)
- it always wants to ignore duplicates

Updated

6 years ago
Target Milestone: --- → 20
Bumping to 22 so that Selena can implement these.
Assignee: josh → sdeckelmann
Target Milestone: 20 → 22
Target Milestone: 22 → 23
(In reply to Adrian Gaudebert [:adrian] from comment #0)
> We tried to use the same function to add a release from the UI and from the
> ftpscrapper, but it's just too different to work, so we will need to have
> two functions, taking different parameters and raising different errors. 
> 
> The current add_new_release function works fine for the UI, except: 
> - it should insert a release name and not a product name into releases_raw

Does this mean that releases_raw needs a new column? 

That table currently contains the columns: 

product_name, version, platform, build_id, build_type, beta_number, repository

> - the ignore_duplicates parameter is useless
> - the update_product should be true by default, we want to update every time
> we add a release from the UI

These are both easy to accommodate

> The new function (to be used by the ftpscrapper) should behave the same but:
> - it takes a release name as parameter (as opposed to a product name)
> - it always wants to ignore duplicates

Same question as above -- is this a request to add a column to releases_raw?
From IRC with Josh, it appears that this is *not* a request for a new column :)

The way that the current code works is a bit confusing because of variable naming, but I'll explain here: 

There's an input variable named 'product'

Here's the code from the function:

-- If the input variable 'product' matches a release_name from table "products", then that release_name is put into variable 'rname'.
SELECT release_name INTO rname
FROM products WHERE release_name = product;
-- If no match was found, then 'product' is compared to product_name in table "products", and the release_name for a matching product_name is put into variable 'rname'
IF rname IS NULL THEN   
 SELECT release_name INTO rname
    FROM products WHERE product_name = product;
    IF rname IS NULL THEN
        RAISE EXCEPTION 'You must supply a valid product or product release name';
    END IF;
END IF;
Target Milestone: 23 → 25
Target Milestone: 25 → Future
Assignee: sdeckelmann → nobody
(Reporter)

Comment 4

a year ago
This is definitely not needed anymore.
Status: NEW → RESOLVED
Last Resolved: a year ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.