Skip to content

Commit

Permalink
added missing info param for github webhook processor
Browse files Browse the repository at this point in the history
  • Loading branch information
suculent committed Nov 15, 2023
1 parent 1417acb commit 5800e46
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 4 additions & 6 deletions lib/thinx/repository.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ module.exports = class Repository {
return (path.indexOf("/" + latest) == -1);
}

purge_old_repos_with_full_name(repositories, name) {
purgeRepositoriesWithFullName(repositories, name) {

const deviceFolders = (repos) => {
if (typeof (repos) === "undefined") return [];
Expand Down Expand Up @@ -143,20 +143,18 @@ module.exports = class Repository {
return false;
}

this.purge_old_repos_with_full_name(repositories, name);
this.purgeRepositoriesWithFullName(repositories, name);

repositories = Repository.findAllRepositoriesWithFullname(name);
console.log(`☣️ [debug] [process_hook] [spec] Repositories after purge: ${repositories}`);
this.queue_updated_repos(repositories);
this.queue_updated_repos(repositories, info);
return true;
}

queue_updated_repos(repositories) {
queue_updated_repos(repositories, info) {
const src = new Sources();
for (let local_path of repositories) {
let owner_id = src.ownerIdFromPath(local_path);
// If no source.secret is set in repository, ignore github secret
// TODO: FIXME! MISSING INFO: info.repository.name and info.ref are used...
src.withRepository(info, local_path, (source_ids) => {
if ((typeof (source_ids) === "undefined" || source_ids.length == 0)) {
console.log(`[info] No sources to be queued with local_path ${local_path}`);
Expand Down
2 changes: 1 addition & 1 deletion spec/jasmine/RepositorySpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ describe("Repository", function() {
watcher = new Repository(messenger, redis, queue_with_cron);
let name = "esp";
let repositories = Repository.findAllRepositoriesWithFullname("esp8266");
watcher.purge_old_repos_with_full_name(repositories, name);
watcher.purgeRepositoriesWithFullName(repositories, name);
expect(watcher).to.be.an('object');
});

Expand Down

0 comments on commit 5800e46

Please sign in to comment.