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

Ws add link recognize script #41

Open
wants to merge 11 commits into
base: development
Choose a base branch
from
6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .meteor/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
dev_bundle
local
2 changes: 1 addition & 1 deletion .meteor/release
Original file line number Diff line number Diff line change
@@ -1 +1 @@
METEOR@1.0.3.2
METEOR@1.3.5.1
2 changes: 1 addition & 1 deletion client/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
<footer>
<hr>
<a href="https://github.com/mrkoreye/testy">Code on GitHub</a>
<a class="pull-right" href="https://sites.google.com/a/popsugar.com/shopstyle-wiki/testing/testing-app">Testing Wiki</a>
<a class="pull-right" href="https://wiki.sugarops.com/doku.php">Wiki</a>
</footer>
</template>
18 changes: 18 additions & 0 deletions client/views/testscripts/testscript.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
Template.testscript.rendered = function(){
if (!this.rendered) {
this.findAll('.testscript-steps').forEach(function(html) {
var new_html = html.innerHTML.replace(/(((ftp|https?|http?|www.?):\/\/)[\-\w@:%_\+.~#;?,&\/\/=]+)/g, function(text, link) {
var real_link = link.replace(",","");
link = link.replace(/^(.*)(?:musthave\.local\.onsugar\.)(.*)/, '$1musthaveqa.popsugar.$2');
if (real_link[real_link.length-1] === ".") real_link = real_link.slice(0,-1);
real_link = real_link.replace(/^(.*)(?:musthave\.local\.onsugar\.)(.*)/, '$1musthaveqa.popsugar.$2');
return '<a href="'+ real_link +'" target="_blank">'+ link +'</a>';
});

html.innerHTML = new_html;
});

this.rendered = true;
}

};
Template.testscript.events({
'click .failure-reason-cancel': function(e) {
failReason = $(e.currentTarget).parents('.failure-reason');
Expand Down
8 changes: 4 additions & 4 deletions lib/config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Config = {
jira: {
protocol: 'https://',
host: 'shopstyle.atlassian.net',
user: 'shopstylebot',
host: 'popsugar.atlassian.net',
user: 'popsugarwrangler',
verifiedStatusName: 'Verified',
mergedStatusName: 'Merged',
mergedStatusName: 'Testing',
toDoStatusName: 'To Do',
inProgressStatusName: 'In Progress',
inReviewStatusName: 'In Review',
Expand All @@ -13,9 +13,9 @@ Config = {
defaultNumTestersPerTicket: 2,
notAssignedName: '-- Not Assigned',
browserOptions: [
'IE9',
'IE10',
'IE11',
'Edge',
'Chrome',
'Firefox',
'iPad',
Expand Down
12 changes: 6 additions & 6 deletions packages/assembla/assembla.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Assembla = {
milestonesUrl: 'https://api.assembla.com/v1/spaces/shopstyle/milestones/upcoming.json',
ticketsUrl: 'https://api.assembla.com/v1/spaces/shopstyle/tickets/milestone/',
usersUrl: 'https://api.assembla.com/v1/spaces/shopstyle/users.json',
assemblaUrl: 'https://www.assembla.com/spaces/shopstyle/tickets/',
ticketUrl: 'https://api.assembla.com/v1/spaces/shopstyle/tickets/',
milestonesUrl: 'https://api.assembla.com/v1/spaces/popsugar/milestones/upcoming.json',
ticketsUrl: 'https://api.assembla.com/v1/spaces/popsugar/tickets/milestone/',
usersUrl: 'https://api.assembla.com/v1/spaces/popsugar/users.json',
assemblaUrl: 'https://www.assembla.com/spaces/popsugar/tickets/',
ticketUrl: 'https://api.assembla.com/v1/spaces/popsugar/tickets/',
testscriptsAndcommentRegex: /TESTING([\s\S]*)END/,
commentRegex: /COMMENTS([\s\S]*?)(?=TESTSCRIPT)/,
testscriptsRegex: /TESTSCRIPT([\s\S]*)/,
Expand Down Expand Up @@ -233,7 +233,7 @@ Assembla.watchTicketStream = function() {
if (date < lastTime) {
return;
}
if (item.ticket && item.author_name !== "shopstylebot") {
if (item.ticket && item.author_name !== "popsugarbot") {
var url = Assembla.ticketUrl + item.ticket.number + '.json';
var ticket = Assembla.makeGetRequest(url, {});
Assembla.updateSingleTicket(ticket.data);
Expand Down
12 changes: 6 additions & 6 deletions server/assembla.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Assembla = {
// milestonesUrl: 'https://api.assembla.com/v1/spaces/shopstyle/milestones/upcoming.json',
// ticketsUrl: 'https://api.assembla.com/v1/spaces/shopstyle/tickets/milestone/',
// usersUrl: 'https://api.assembla.com/v1/spaces/shopstyle/users.json',
// assemblaUrl: 'https://www.assembla.com/spaces/shopstyle/tickets/',
// ticketUrl: 'https://api.assembla.com/v1/spaces/shopstyle/tickets/',
// milestonesUrl: 'https://api.assembla.com/v1/spaces/popsugar/milestones/upcoming.json',
// ticketsUrl: 'https://api.assembla.com/v1/spaces/popsugar/tickets/milestone/',
// usersUrl: 'https://api.assembla.com/v1/spaces/popsugar/users.json',
// assemblaUrl: 'https://www.assembla.com/spaces/popsugar/tickets/',
// ticketUrl: 'https://api.assembla.com/v1/spaces/popsugar/tickets/',
// testscriptsAndcommentRegex: /TESTING([\s\S]*)END/,
// commentRegex: /COMMENTS([\s\S]*?)(?=TESTSCRIPT)/,
// testscriptsRegex: /TESTSCRIPT([\s\S]*)/,
Expand Down Expand Up @@ -233,7 +233,7 @@
// if (date < lastTime) {
// return;
// }
// if (item.ticket && item.author_name !== "shopstylebot") {
// if (item.ticket && item.author_name !== "popsugarbot") {
// var url = Assembla.ticketUrl + item.ticket.number + '.json';
// var ticket = Assembla.makeGetRequest(url, {});
// Assembla.updateSingleTicket(ticket.data);
Expand Down
9 changes: 5 additions & 4 deletions server/jira.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ Jira = {
// 'project/BE/versions' is used because versions are specific to projects.
// PM's keep all versions on all prjects, so we just hit the BE project endpoint
// and get its versions, which should be shopstyle wide
milestonesUrl: 'project/BE/versions',
// This needs to be updated for PopSugar
milestonesUrl: 'project/TTP/versions',
usersUrl: 'group',
ticketUrl: 'search',
testscriptCustomField: 'customfield_10111',
Expand Down Expand Up @@ -118,7 +119,7 @@ Jira.updateSingleTicket = function(ticket) {

Jira.updateTestscripts(ticket);

var jiraUrl = 'https://shopstyle.atlassian.net/browse/' + ticket.key;
var jiraUrl = 'https://popsugar.atlassian.net/browse/' + ticket.key;
var statusName = ticket.fields.status.name;
var jiraId = parseInt(ticket.id);
if (statusName === Config.jira.verifiedStatusName) {
Expand Down Expand Up @@ -264,7 +265,7 @@ Jira.verifyTicketOnDev = function(ticket) {
// Perform transition id 131, aka "Verify" action
var data = {
transition: {
id: 131
id: 111
}
};

Expand All @@ -285,7 +286,7 @@ Jira.reOpenTicket = function(ticket) {
// Perform transition id 201, aka "Reopen" action
var data = {
transition: {
id: 201
id: 11
}
};

Expand Down