Skip to content

removed data science bugzilla stuff with jira#2316

Merged
tiftran merged 14 commits into
mozilla:masterfrom
tiftran:2303
Mar 9, 2020
Merged

removed data science bugzilla stuff with jira#2316
tiftran merged 14 commits into
mozilla:masterfrom
tiftran:2303

Conversation

@tiftran

@tiftran tiftran commented Feb 26, 2020

Copy link
Copy Markdown
Contributor

No description provided.

@tiftran tiftran force-pushed the 2303 branch 2 times, most recently from cec60e7 to 488b74a Compare February 27, 2020 21:32

@jaredlockhart jaredlockhart left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice @tiftran 🙆

Buncha nitty changes but overall looks great thank you! 🐻

Comment thread .env.sample Outdated
DB_USER=postgres
DEBUG=True
DELIVERY_CONSOLE_HOST=
DS_ISSUE_HOST=

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a dev/staging jira instance we can put in here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From lurking in the jira-support channel, I don't think there's a dev instance, there's https://jira.allizom.org which they call staging, but it seems to be more like a space for people to set up jira projects before they get migrated to production

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay then just stick https://jira.example.com/ in there, we'll need something in there for integration tests to pass.

Comment thread app/experimenter/experiments/forms.py Outdated
Comment thread app/experimenter/experiments/forms.py Outdated
Comment thread app/experimenter/experiments/forms.py Outdated
Comment thread app/experimenter/experiments/tasks.py
Comment thread app/experimenter/experiments/tests/test_views.py Outdated
Comment thread app/experimenter/experiments/tests/test_views.py Outdated
Comment thread app/experimenter/experiments/tests/test_views.py
experiment.public_name = "Public Name"
experiment.public_description = "Public Description"
experiment.bugzilla_url = "http://bugzilla.com/show_bug.cgi?id=1234"
experiment.bugzilla_url = "https://jira.mozilla.com/browse/DS-123"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hrmmmm I'll need to update my integration test PR for this

experiment.public_name = "Public Name"
experiment.public_description = "Public Description"
experiment.bugzilla_url = "http://bugzilla.com/show_bug.cgi?id=1234"
experiment.bugzilla_url = "https://jira.mozilla.com/browse/DS-123"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leave these like this and we'll land this first and I'll fix it in my PR

@tiftran tiftran requested a review from jaredlockhart March 4, 2020 23:56

@jaredlockhart jaredlockhart left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes tif! Just a couple last things.

Comment thread app/experimenter/experiments/forms.py Outdated
Comment on lines +55 to +68
DS_root = urljoin(settings.DS_ISSUE_HOST, "DS-")
DO_root = urljoin(settings.DS_ISSUE_HOST, "DO-")

if (
DS_root not in cleaned_value and DO_root not in cleaned_value
) or self.get_ds_issue_id(cleaned_value) is None:

raise forms.ValidationError(err_str.format(ds_url=settings.DS_ISSUE_HOST))
return cleaned_value

def get_ds_issue_id(self, bug_url):
ds = re.match(re.escape(settings.DS_ISSUE_HOST) + r"(DS|DO)-(\w+.*)", bug_url)

return ds.group(1)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait what am I thinking, couldn't you do this whole thing with just the regex match looking for the ID and if match is None then we know it's invalid?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

being the regex newbie, what do you mean by regex match looking for the ID, like if the url ends in numbers?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean like if ds is None, then the regex failed to find the ID at the end of the URL because it didn't match the regex, so then we know whatever URL was provided isn't a 'valid' jira URL, which accomplishes the same thing as the two not in checks above it, so you should be able to remove them and just do the regex check?

Comment thread .env.sample Outdated
DB_USER=postgres
DEBUG=True
DELIVERY_CONSOLE_HOST=
DS_ISSUE_HOST=

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay then just stick https://jira.example.com/ in there, we'll need something in there for integration tests to pass.

@tiftran tiftran requested a review from jaredlockhart March 9, 2020 17:02

@jaredlockhart jaredlockhart left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tiftran Just change those two little things and this is good to go 👍 Thanks tif!!

Comment thread .env.sample Outdated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: https://jira.example.com/browse/

Comment thread app/experimenter/experiments/forms.py Outdated
Comment on lines 59 to 62

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just inline this above, doesn't need to be a method

@tiftran tiftran merged commit 45cbc78 into mozilla:master Mar 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants