-
Notifications
You must be signed in to change notification settings - Fork 0
Init implementation #1
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
Conversation
|
Changes Unknown when pulling 51c6bde on init into * on master*. |
|
Changes Unknown when pulling 6365644 on init into * on master*. |
lib/load-compatible-agents.js
Outdated
| return got(agentsUrl) | ||
| .then(parseXMLResponse) | ||
| .then(data => { | ||
| const agents = getAgetns(data); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getAgents
| return Promise.all([ | ||
| loadBuild(buildUrl), | ||
| loadAgents(buildUrl) | ||
| ]).then(data => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
там нету spread?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Нет, в ES6 .spread() не нужен, т.к. есть spread оператор:
Promise.all([...]).then([build, agents] => {});Но в 4й ноде его нет.
|
Капитально прям подошёл! |
| API | ||
| --- | ||
|
|
||
| ### queueInfo(url[, options]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Это как-то автоматически генерируется?
Меня всегда смущало, что имена методов и параметров в такой доке пишутся не моноширинным шрифтом. Типа, таким образом иллюстрируя, что это код.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Я руками пишу.
И так понятно что это про код. А использовать двойные выделения (заголовок уже выделен) плохой тон.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Можно генерить чем-то вроде verb.
|
/ok |
|
🆙 |
|
|
||
| ```js | ||
| queueInfo('http://teamcity.domain.com', { | ||
| projectPattern: 'project :: Pull requests :: *' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А как правильно написать, чтобы все подпроекты учитывались? Две звёздочки?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Одна звёздочка матчится на все подпроекты.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Понятно, давай может добавим такой случай в пример ниже?
lib/build-filter.js
Outdated
| } | ||
|
|
||
| const hasCompatibleAgents = build.compatibleAgents && build.compatibleAgents.length !== 0; | ||
| if (options.ignoreIncompatibleAgents && build.state === 'queued' && hasCompatibleAgents) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Я бы это условие и одно выше вынес в именованные функции.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ну, всё, что связано с анализом объекта build
| * @param {string} buildUrl - the relative url to build. | ||
| * @returns {object} | ||
| */ | ||
| function loadBuild(buildUrl) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Смущает, что сюда приходит ссылка, а не buildId, например. Что ссылка формируется где-то в другом месте. Размазывание логики, кмк. Но решай сам.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Одного buildId мало, можно целиком build передавать.
Но формирование урла зависит от переданного teamcityUrl.
|
Ok! 👌 чт, 2 июня 2016 г., 0:36 Andrew Abramov [email protected]:
|
1634599 to
06a6dac
Compare
|
🆙 |
9f8b8b4 to
259dac3
Compare
No description provided.