Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: snyk/snyk-api-import
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.21.4
Choose a base ref
...
head repository: snyk/snyk-api-import
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v2.21.5
Choose a head ref
  • 3 commits
  • 4 files changed
  • 2 contributors

Commits on Nov 15, 2024

  1. fix: ignore disabled azure repos from listing

    novalex committed Nov 15, 2024
    Copy the full SHA
    779232e View commit details

Commits on Nov 18, 2024

  1. fix: update expected number of Gitlab groups

    novalex committed Nov 18, 2024
    Copy the full SHA
    0afee01 View commit details
  2. Merge pull request #497 from snyk/fix/azure-repos-ignore-disabled

    fix: ignore disabled azure repos from listing
    novalex authored Nov 18, 2024
    Copy the full SHA
    89889e0 View commit details
6 changes: 3 additions & 3 deletions src/lib/source-handlers/azure/list-repos.ts
Original file line number Diff line number Diff line change
@@ -15,6 +15,7 @@ interface AzureReposResponse {
name: string;
project: { name: string };
defaultBranch: string;
isDisabled: boolean;
}[];
}
export async function fetchAllRepos(
@@ -61,9 +62,8 @@ async function getRepos(
Response body: ${JSON.stringify(body)}`);
}
const { value: repos } = body;
repos.map((repo) => {
const { name, project, defaultBranch } = repo;
if (name && project && project.name && defaultBranch) {
repos.map(({ name, project, defaultBranch, isDisabled }) => {
if (name && project && project.name && defaultBranch && !isDisabled) {
repoList.push({
name,
owner: project.name,
2 changes: 1 addition & 1 deletion test/lib/fixtures/azure/org-repos.json
Original file line number Diff line number Diff line change
@@ -58,7 +58,7 @@
"remoteUrl": "https://dev.azure.com/remoteUrl",
"sshUrl": "",
"webUrl": "https://dev.azure.com/remoteUrl",
"isDisabled": false
"isDisabled": true
}
],
"count": 3
2 changes: 1 addition & 1 deletion test/lib/source-handlers/azure/azure.test.ts
Original file line number Diff line number Diff line change
@@ -70,7 +70,7 @@ describe('Testing azure-devops interaction', () => {
});
test('Test listAzureRepos with one page', async () => {
const repos = await listAzureRepos('reposTestOrg', 'https://azure-tests');
expect(repos).toHaveLength(3);
expect(repos).toHaveLength(2);
});
test('listAzureRepos to fail', async () => {
expect(async () => {
2 changes: 1 addition & 1 deletion test/system/orgs:data/gitlab.test.ts
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@ describe('General `snyk-api-import orgs:data <...>`', () => {
expect(stderr).toEqual('');
expect(err).toBeNull();
expect(stdout).toMatch(
'Found 7 group(s). Written the data to file: group-hello-gitlab-orgs.json',
'Found 9 group(s). Written the data to file: group-hello-gitlab-orgs.json',
);
deleteFiles([
path.resolve(__dirname, `group-${groupId}-gitlab-orgs.json`),