Skip to content
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

feat(yaml): add yaml as valid file format #1

Closed
wants to merge 61 commits into from

Conversation

dabcoder
Copy link
Owner

To keep discussing github#700

@dabcoder dabcoder marked this pull request as ready for review November 26, 2024 09:52
@anderssonjohan
Copy link

@dabcoder Nice! Can you also update the README and remove the comment about .yaml being ignored? 🙏

@dabcoder
Copy link
Owner Author

dabcoder commented Dec 19, 2024

Thanks for the feedback @anderssonjohan. I can certainly update the README.
Test wise, as far as I can see the getRepoConfigs method does not return anything that can be unit tested (unless I am mistaken), and I am also unsure how to test the childPluginsList method (test the content of the childPlugins array?). Let me know if you have any pointers in that area.
EDIT: getRepoConfigs does return an Object.

Bumps [azure/aks-set-context](https://github.com/azure/aks-set-context) from 3 to 4.
- [Release notes](https://github.com/azure/aks-set-context/releases)
- [Changelog](https://github.com/Azure/aks-set-context/blob/main/CHANGELOG.md)
- [Commits](Azure/aks-set-context@v3...v4)

---
updated-dependencies:
- dependency-name: azure/aks-set-context
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@anderssonjohan
Copy link

@dabcoder If I were you I would start by isolating the code under test into a helper function and test that. Then you only have to test the changed logic and not everything around it.

  1. Extract function, something like:
function getRepoOverrideConfig(repoConfigs, repository) {
  return repoConfigs[`${repository.repo}.yml`];
}
  1. Write failing test
const repoConfigs = { "repository.yaml": "yaml file was picked" };
const repo = { repo: "repository" };

expect(getRepoOverrideConfig(repoConfigs, repo).toEqual("yaml file was picked");
  1. Update the helper with your suggested changes
  2. Write a test for current behavior
const repoConfigs = { "repository.yml": "yml file was picked" };
const repo = { repo: "repository" };

expect(getRepoOverrideConfig(repoConfigs, repo).toEqual("yml file was picked");
  1. Document the precedence with a test
const repoConfigs = { "repository.yaml": "yaml file was picked", "repository.yml": "yml file was picked" };
const repo = { repo: "repository" };

expect(getRepoOverrideConfig(repoConfigs, repo).toEqual("yml file was picked");

dependabot bot and others added 10 commits December 19, 2024 12:24
Bumps [azure/k8s-create-secret](https://github.com/azure/k8s-create-secret) from 4 to 5.
- [Release notes](https://github.com/azure/k8s-create-secret/releases)
- [Changelog](https://github.com/Azure/k8s-create-secret/blob/main/CHANGELOG.md)
- [Commits](Azure/k8s-create-secret@v4...v5)

---
updated-dependencies:
- dependency-name: azure/k8s-create-secret
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [azure/login](https://github.com/azure/login) from 1 to 2.
- [Release notes](https://github.com/azure/login/releases)
- [Commits](Azure/login@v1...v2)

---
updated-dependencies:
- dependency-name: azure/login
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Add glob matching to include/exclude in diffable

* Update the README

---------

Co-authored-by: Adrian Veliz <[email protected]>
Bumps [Azure/k8s-deploy](https://github.com/azure/k8s-deploy) from 4.10 to 5.
- [Release notes](https://github.com/azure/k8s-deploy/releases)
- [Changelog](https://github.com/Azure/k8s-deploy/blob/main/CHANGELOG.md)
- [Commits](Azure/k8s-deploy@v4.10...v5)

---
updated-dependencies:
- dependency-name: Azure/k8s-deploy
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Yadhav Jayaraman <[email protected]>
@dabcoder
Copy link
Owner Author

● Settings Tests › getRepoOverrideConfig › repository defined in a file using the .yaml extension › Picks up a repository defined in file using the .yaml extension

    TypeError: Cannot read properties of undefined (reading 'repository.yml')

      415 |
      416 |   getRepoOverrideConfig(repoName) {
    > 417 |     return this.repoConfigs[`${repoName}.yml`] || this.repoConfigs[`${repoName}.yaml`] || {}
          |                            ^
      418 |   }
      419 |
      420 |   validate (section, baseConfig, overrideConfig) {

      at Settings.getRepoOverrideConfig (lib/settings.js:417:28)
      at Object.getRepoOverrideConfig (test/unit/lib/settings.test.js:156:37)

  ● Settings Tests › getRepoOverrideConfig › repository defined in a file using the .yml extension › Picks up a repository defined in file using the .yml extension

    TypeError: Cannot read properties of undefined (reading 'repository.yml')

      415 |
      416 |   getRepoOverrideConfig(repoName) {
    > 417 |     return this.repoConfigs[`${repoName}.yml`] || this.repoConfigs[`${repoName}.yaml`] || {}
          |                            ^
      418 |   }
      419 |
      420 |   validate (section, baseConfig, overrideConfig) {

      at Settings.getRepoOverrideConfig (lib/settings.js:417:28)
      at Object.getRepoOverrideConfig (test/unit/lib/settings.test.js:175:37)

@anderssonjohan
Copy link

@dabcoder You're passing the repoConfigs as the config object but they are not read from the config. They are loaded here:

this.repoConfigs = await this.getRepoConfigs(repo)

You can probably fix it by:

settings = createSettings({}).repoConfigs = ...

dependabot bot and others added 10 commits December 21, 2024 16:54
Bumps [@travi/any](https://github.com/travi/any) from 2.1.10 to 3.1.2.
- [Release notes](https://github.com/travi/any/releases)
- [Commits](travi/any@v2.1.10...v3.1.2)

---
updated-dependencies:
- dependency-name: "@travi/any"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Yadhav Jayaraman <[email protected]>
Bumps [@eslint/eslintrc](https://github.com/eslint/eslintrc) from 2.1.4 to 3.1.0.
- [Release notes](https://github.com/eslint/eslintrc/releases)
- [Changelog](https://github.com/eslint/eslintrc/blob/main/CHANGELOG.md)
- [Commits](eslint/eslintrc@v2.1.4...v3.1.0)

---
updated-dependencies:
- dependency-name: "@eslint/eslintrc"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Yadhav Jayaraman <[email protected]>
Bumps [eslint-plugin-promise](https://github.com/eslint-community/eslint-plugin-promise) from 6.1.1 to 6.6.0.
- [Release notes](https://github.com/eslint-community/eslint-plugin-promise/releases)
- [Changelog](https://github.com/eslint-community/eslint-plugin-promise/blob/main/CHANGELOG.md)
- [Commits](eslint-community/eslint-plugin-promise@v6.1.1...v6.6.0)

---
updated-dependencies:
- dependency-name: eslint-plugin-promise
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Yadhav Jayaraman <[email protected]>
* add initial code for preventing multiple suborg config for repos

* detect conflict even when a single suborg config is changed

* remove duplicate errors

* dont add nulls and undefined to results

* Update ESLint config for browser and standard
…b#686)

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
* feat: add JSON schema doc for settings

* add script to generate dereferenced schema

---------

Co-authored-by: Jonathan Morley <[email protected]>
…erability (github#720)

* Update vulnerable dependency

Signed-off-by: Brett Logan <[email protected]>

* Pin non-immutable Actions in deploy-k8s

Signed-off-by: Brett Logan <[email protected]>

* Pin non-immutable Actions in rc-release

Signed-off-by: Brett Logan <[email protected]>

* Pin non-immutable Actions in create-pre-release

Signed-off-by: Brett Logan <[email protected]>

* Pin non-immutable Actions in create-release

Signed-off-by: Brett Logan <[email protected]>

* Remove dead reusable workflow

Signed-off-by: Brett Logan <[email protected]>

* Add workflow permissions

Signed-off-by: Brett Logan <[email protected]>

---------

Signed-off-by: Brett Logan <[email protected]>
* fix: update eslint ecmaVersion to 13

Linting failed in deploymentConfig.js due to the static fields. Eslint supports this from ecmaVersion 13.

* reapply eslint to tests, still supporting jest

The full test suite failed because it tried to lint the tests, while the running linter did not do the same. Enabling linting gave errors due to jest having undef stuff, but overriding these files for jest env keeps the linting without these errors.

* removed unused vars in index.js

Removed to stop having eslint errors.

* fix eslint errors, except environments

Updated with `npx standard --fix`.

Skipping environments.js and environments.test.js as they had a lot of
errors, handling those in a separate commit.

* fix eslint errors for environments

Updated with `npx standard --fix`.

* fix eslint casing errors for environments

This was done manually as no autofix was available.

* Enteprise sourcetype rulesets should not be handled at the org level

* Securtiy manager teams should not be handled as other teams

---------

Co-authored-by: Torgeir S <[email protected]>
* Bump probot from 12.3.4 to 13.3.8

Bumps [probot](https://github.com/probot/probot) from 12.3.4 to 13.3.8.
- [Release notes](https://github.com/probot/probot/releases)
- [Commits](probot/probot@v12.3.4...v13.3.8)

---
updated-dependencies:
- dependency-name: probot
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

* resolve conflicts

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Yadhav Jayaraman <[email protected]>
Co-authored-by: Åkesson Karl-Petter <[email protected]>
Co-authored-by: Yadhav Jayaraman <[email protected]>
@dabcoder
Copy link
Owner Author

@anderssonjohan would you have time to take a look at my PR against the main repo?

dependabot bot and others added 12 commits March 3, 2025 16:02
Bumps [lockfile-lint](https://github.com/lirantal/lockfile-lint/tree/HEAD/packages/lockfile-lint) from 4.13.2 to 4.14.0.
- [Release notes](https://github.com/lirantal/lockfile-lint/releases)
- [Changelog](https://github.com/lirantal/lockfile-lint/blob/main/packages/lockfile-lint/CHANGELOG.md)
- [Commits](https://github.com/lirantal/lockfile-lint/commits/[email protected]/packages/lockfile-lint)

---
updated-dependencies:
- dependency-name: lockfile-lint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…b#769)

Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 3.8.0 to 3.10.0.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](docker/setup-buildx-action@6524bf6...b5ca514)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Yadhav Jayaraman <[email protected]>
…#770)

Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 6.10.0 to 6.15.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](docker/build-push-action@48aba3b...471d1dc)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [docker/metadata-action](https://github.com/docker/metadata-action) from 5.6.1 to 5.7.0.
- [Release notes](https://github.com/docker/metadata-action/releases)
- [Commits](docker/metadata-action@369eb59...902fa8e)

---
updated-dependencies:
- dependency-name: docker/metadata-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action) from 3.2.0 to 3.6.0.
- [Release notes](https://github.com/docker/setup-qemu-action/releases)
- [Commits](docker/setup-qemu-action@49b3bc8...2910929)

---
updated-dependencies:
- dependency-name: docker/setup-qemu-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…b#773)

Bumps [@probot/adapter-aws-lambda-serverless](https://github.com/probot/adapter-aws-lambda-serverless) from 3.0.4 to 4.0.3.
- [Release notes](https://github.com/probot/adapter-aws-lambda-serverless/releases)
- [Commits](probot/adapter-aws-lambda-serverless@v3.0.4...v4.0.3)

---
updated-dependencies:
- dependency-name: "@probot/adapter-aws-lambda-serverless"
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Yadhav Jayaraman <[email protected]>
* Bump nock from 13.5.6 to 14.0.1

Bumps [nock](https://github.com/nock/nock) from 13.5.6 to 14.0.1.
- [Release notes](https://github.com/nock/nock/releases)
- [Changelog](https://github.com/nock/nock/blob/main/CHANGELOG.md)
- [Commits](nock/nock@v13.5.6...v14.0.1)

---
updated-dependencies:
- dependency-name: nock
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

* update package-lock

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Yadhav Jayaraman <[email protected]>
Bumps [smee-client](https://github.com/probot/smee-client) from 1.2.5 to 3.1.1.
- [Release notes](https://github.com/probot/smee-client/releases)
- [Commits](probot/smee-client@v1.2.5...v3.1.1)

---
updated-dependencies:
- dependency-name: smee-client
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Yadhav Jayaraman <[email protected]>
…#779)

* Bump the npm_and_yarn group across 1 directory with 3 updates

Bumps the npm_and_yarn group with 2 updates in the / directory: [octokit](https://github.com/octokit/octokit.js) and [probot](https://github.com/probot/probot).


Updates `octokit` from 3.2.0 to 4.1.2
- [Release notes](https://github.com/octokit/octokit.js/releases)
- [Commits](octokit/octokit.js@v3.2.0...v4.1.2)

Updates `probot` from 12.4.0 to 13.4.4
- [Release notes](https://github.com/probot/probot/releases)
- [Commits](probot/probot@v12.4.0...v13.4.4)

Updates `@octokit/request-error` from 2.1.0 to 5.1.1
- [Release notes](https://github.com/octokit/request-error.js/releases)
- [Commits](octokit/request-error.js@v2.1.0...v5.1.1)

---
updated-dependencies:
- dependency-name: octokit
  dependency-type: direct:production
  dependency-group: npm_and_yarn
- dependency-name: probot
  dependency-type: direct:production
  dependency-group: npm_and_yarn
- dependency-name: "@octokit/request-error"
  dependency-type: indirect
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <[email protected]>

* trigger a build

* fix issues with latest octokit

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Yadhav Jayaraman <[email protected]>
* Lint environments.js

Signed-off-by: Kyle Harding <[email protected]>

* Restore list of variables to be deleted

Signed-off-by: Kyle Harding <[email protected]>

* Add tests to update and delete environment vars

Signed-off-by: Kyle Harding <[email protected]>

---------

Signed-off-by: Kyle Harding <[email protected]>
@dabcoder
Copy link
Owner Author

Upstream PR was merged, closing this.

@dabcoder dabcoder closed this Mar 17, 2025
@dabcoder dabcoder deleted the db/-/yaml-extension branch March 17, 2025 10:38
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.