Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removed data science bugzilla stuff with jira #2316

Merged
merged 14 commits into from
Mar 9, 2020
Merged

Conversation

tiftran
Copy link
Contributor

@tiftran tiftran commented Feb 26, 2020

No description provided.

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

@jaredlockhart jaredlockhart left a comment

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! 🐻

.env.sample Outdated
@@ -7,6 +7,7 @@ DB_PASS=postgres
DB_USER=postgres
DEBUG=True
DELIVERY_CONSOLE_HOST=
DS_ISSUE_HOST=
Copy link
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
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
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.

app/experimenter/experiments/forms.py Outdated Show resolved Hide resolved
app/experimenter/experiments/forms.py Outdated Show resolved Hide resolved
app/experimenter/experiments/forms.py Outdated Show resolved Hide resolved
app/experimenter/experiments/tasks.py Show resolved Hide resolved
app/experimenter/experiments/tests/test_views.py Outdated Show resolved Hide resolved
app/experimenter/experiments/tests/test_views.py Outdated Show resolved Hide resolved
@@ -40,5 +40,5 @@ def fill_overview(selenium, base_url):
experiment.short_description = "Testing in here"
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
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

@@ -14,7 +14,7 @@ def test_add_branch(base_url, selenium):
experiment.short_description = "Testing in here"
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
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
Copy link
Collaborator

@jaredlockhart jaredlockhart left a comment

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 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
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
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
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?

.env.sample Outdated
@@ -7,6 +7,7 @@ DB_PASS=postgres
DB_USER=postgres
DEBUG=True
DELIVERY_CONSOLE_HOST=
DS_ISSUE_HOST=
Copy link
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
Copy link
Collaborator

@jaredlockhart jaredlockhart left a comment

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!!

.env.sample Outdated
@@ -7,6 +7,7 @@ DB_PASS=postgres
DB_USER=postgres
DEBUG=True
DELIVERY_CONSOLE_HOST=
DS_ISSUE_HOST=https://jira.mozilla.com
Copy link
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 on lines 59 to 62
def validate_ds_issue_url(self, bug_url):
ds = re.match(re.escape(settings.DS_ISSUE_HOST) + r"(DS|DO)-(\w+.*)", bug_url)

return ds
Copy link
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