-
Notifications
You must be signed in to change notification settings - Fork 112
Cannot configure Code repo widget #172
Comments
@Courtneyp123 can you take a look at it when you get some time |
Hi @jbadeau those versions are compatible together. Could you tell me what data you're populating the widget with? We can take it from there. |
So I compared the old UI and the the new UI and I noticed that
{
"name": "repo",
"componentId": "5fcb5c68710718385c7a4e5c",
"options": {
"id": "repo0",
"scm": {
"name": "Bitbucket",
"value": "Bitbucket"
},
"url": "https://stash.xxx.net/scm/systeam/xxx.git",
"branch": "master",
"userID": "",
"password": "",
"personalAccessToken": ""
},
"collectorItemIds": [
"5fcb5c83710718385c7a4e60"
]
} I have fixed this in a fork and it working fine now but I am puzzled how this is working for you? |
I am getting the same issue with the new UI - the collector items aren't registered correctly and therefore the scm collectors never pick up any new repos registered through the UI. The only way this seems to have been avoided/un noticed is that webbook triggers will register commits to the db which are then picked up by the collectors. @jbadeau if you could share your fork I can test for GitHub based repos |
@jbadeau I noticed the same issue. the repo-config-form doesnt seem like making call to save data into db. Can you share your fork? |
working through this - it looks like the old repo config.js uses the following function /*
* function submitForm(valid, url) { ctrl.submitted = true; if (valid &&
* ctrl.collectors.length) {
* createCollectorItem(url).then(processCollectorItemResponse); } }
*/
function submitForm(form) {
ctrl.submitted = true;
if (form.$valid && ctrl.collectors.length) {
//there is an existing repo and nothing was changed
if (widgetConfig.options.scm) {
if (ctrl.repoOption.name === widgetConfig.options.scm.name &&
ctrl.repoUrl === widgetConfig.options.url &&
ctrl.gitBranch === widgetConfig.options.branch &&
ctrl.repouser === widgetConfig.options.userID &&
ctrl.repopass === widgetConfig.options.password) {
$uibModalInstance.close();
return;
}
}
if (ctrl.repopass) {
if (ctrl.repopass === widgetConfig.options.password) {
//password is unchanged in the form so don't encrypt it again
try {
createCollectorItem().then(processCollectorItemResponse, handleError);
} catch (e) {
console.log(e);
}
} else {
collectorData.encrypt(ctrl.repopass).then(function (response) {
if (response === 'ERROR') {
form.repopass.$setValidity('errorEncryptingPassword', false);
return;
}
ctrl.repopass = response;
try {
createCollectorItem().then(processCollectorItemResponse, handleError);
} catch (e) {
console.log(e);
}
});
}
}
if (ctrl.repoPersonalAccessToken) {
if (ctrl.repoPersonalAccessToken === widgetConfig.options.personalAccessToken) {
//password is unchanged in the form so don't encrypt it again
try {
createCollectorItem().then(processCollectorItemResponse, handleError);
} catch (e) {
console.log(e);
}
} else {
collectorData.encrypt(ctrl.repoPersonalAccessToken).then(function (response) {
ctrl.repoPersonalAccessToken = response;
try {
createCollectorItem().then(processCollectorItemResponse, handleError);
} catch (e) {
console.log(e);
}
});
}
}
else {
createCollectorItem().then(processCollectorItemResponse, handleError);
}
}
} Where the function It seems like the way that this is done in the new UI is different but when we compare the public submitForm() {
const newConfig = {
name: 'repo',
componentId: this.componentId,
options: {
id: this.widgetConfigId ? this.widgetConfigId : 'repo0',
scm: {
name: this.repoConfigForm.value.scm,
value: this.repoConfigForm.value.scm,
},
url: this.repoConfigForm.value.url,
branch: this.repoConfigForm.value.branch,
userID: this.repoConfigForm.value.userID,
password: this.repoConfigForm.value.password,
personalAccessToken: this.repoConfigForm.value.personalAccessToken
},
};
this.activeModal.close(newConfig);
} and the public submitForm() {
const newConfig = {
name: 'build',
options: {
id: this.widgetConfigId ? this.widgetConfigId : 'build0',
buildDurationThreshold: +this.buildConfigForm.value.buildDurationThreshold,
consecutiveFailureThreshold: +this.buildConfigForm.value.consecutiveFailureThreshold
},
componentId: this.componentId,
collectorItemId: this.buildConfigForm.value.buildJob.id
};
this.activeModal.close(newConfig);
} There seems to be a missing member in the repo-config-form-component - I assume that by adding this member in the collector item will be created, but I am unsure what id value to use for the github/scm collector @rvema - would be good to get your/the team's thoughts on this @jbadeau - it would be good if you could confirm that this is the same fix you made |
Hello any update on this issue ? |
Hello,
I am using versions
UI: master
API: 3.3.2-SNAPSHOT
bitbucket-scm-collector: 3.1.2-SNAPSHOT
When I configure the coderepo widget is saves but never populates the data. I have debugged the API call
/v2/dashboard/{id}/widget
and it expects that that request.getCollectorItemIds() i snot null but it is.
The collector_items datebase table does not contain and SCM rows.
Are these versions compatible with each other?
The text was updated successfully, but these errors were encountered: