Skip to content

Conversation

@blond
Copy link
Owner

@blond blond commented Jun 1, 2016

No description provided.

@blond
Copy link
Owner Author

blond commented Jun 1, 2016

/cc @emelyanovtv @rndD @zumra6a

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 51c6bde on init into * on master*.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 6365644 on init into * on master*.

return got(agentsUrl)
.then(parseXMLResponse)
.then(data => {
const agents = getAgetns(data);

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 => {

Choose a reason for hiding this comment

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

там нету spread?

Copy link
Owner Author

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й ноде его нет.

@anton-rudeshko
Copy link

Капитально прям подошёл!

API
---

### queueInfo(url[, options])

Choose a reason for hiding this comment

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

Это как-то автоматически генерируется?
Меня всегда смущало, что имена методов и параметров в такой доке пишутся не моноширинным шрифтом. Типа, таким образом иллюстрируя, что это код.

Copy link
Owner Author

Choose a reason for hiding this comment

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

Я руками пишу.

И так понятно что это про код. А использовать двойные выделения (заголовок уже выделен) плохой тон.

Copy link
Owner Author

Choose a reason for hiding this comment

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

Можно генерить чем-то вроде verb.

@anton-rudeshko
Copy link

/ok
Расскажи потом, как будем использовать этот супер модуль.

@blond
Copy link
Owner Author

blond commented Jun 1, 2016

🆙


```js
queueInfo('http://teamcity.domain.com', {
projectPattern: 'project :: Pull requests :: *'

Choose a reason for hiding this comment

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

А как правильно написать, чтобы все подпроекты учитывались? Две звёздочки?

Copy link
Owner Author

Choose a reason for hiding this comment

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

Одна звёздочка матчится на все подпроекты.

Choose a reason for hiding this comment

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

Понятно, давай может добавим такой случай в пример ниже?

}

const hasCompatibleAgents = build.compatibleAgents && build.compatibleAgents.length !== 0;
if (options.ignoreIncompatibleAgents && build.state === 'queued' && hasCompatibleAgents) {

Choose a reason for hiding this comment

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

Я бы это условие и одно выше вынес в именованные функции.

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) {

Choose a reason for hiding this comment

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

Смущает, что сюда приходит ссылка, а не buildId, например. Что ссылка формируется где-то в другом месте. Размазывание логики, кмк. Но решай сам.

Copy link
Owner Author

Choose a reason for hiding this comment

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

Одного buildId мало, можно целиком build передавать.

Но формирование урла зависит от переданного teamcityUrl.

@anton-rudeshko
Copy link

Ok! 👌

чт, 2 июня 2016 г., 0:36 Andrew Abramov [email protected]:

🆙


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#1 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/ABYJclktIdLZy-i5MF5Co49y5yVBD1myks5qHftfgaJpZM4IrPdl
.

@blond blond force-pushed the init branch 2 times, most recently from 1634599 to 06a6dac Compare June 2, 2016 09:33
@blond
Copy link
Owner Author

blond commented Jun 2, 2016

🆙

@blond blond force-pushed the init branch 2 times, most recently from 9f8b8b4 to 259dac3 Compare June 2, 2016 10:27
@blond blond merged commit 39f13aa into master Jun 2, 2016
@blond blond deleted the init branch June 2, 2016 17:55
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.

4 participants