Skip to content

Commit

Permalink
Publish directory and recursive settings unexpected behavior (#105)
Browse files Browse the repository at this point in the history
* revert previous 2 commits
* bug: when recursive set to false getChartDirs was returning a string instead of expected array. in addition prepCharts was reading srcPath and then iterating over it instead of iterating over whatever was copied to destPath.
* bug: fix readdir to not use recursive option as it has unexpected behavior between environments

---------

Co-authored-by: Rohit Khattar <[email protected]>
  • Loading branch information
ejhayes and rfun authored Nov 1, 2023
1 parent 2ddd316 commit aa9c14d
Show file tree
Hide file tree
Showing 17 changed files with 759 additions and 674 deletions.
18 changes: 9 additions & 9 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
version: 2
updates:
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: "daily"
- package-ecosystem: "docker"
directory: "/"
interval: 'daily'
- package-ecosystem: 'docker'
directory: '/'
schedule:
interval: "daily"
- package-ecosystem: "npm"
directory: "/"
interval: 'daily'
- package-ecosystem: 'npm'
directory: '/'
schedule:
interval: "daily"
interval: 'daily'
44 changes: 22 additions & 22 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
---
version: 1
labels:
- label: "small"
- label: 'small'
size-below: 10
- label: "medium"
- label: 'medium'
size-above: 9
size-below: 200
- label: "large"
- label: 'large'
size-above: 200
- label: "documentation"
- label: 'documentation'
files:
- ".+.md"
- label: "config"
- '.+.md'
- label: 'config'
files:
- ".github"
- ".autorc"
- ".eslintrc"
- ".eslintignore"
- ".prettierrc"
- ".prettierignore"
- ".all-contributorsrc"
- "environments"
- ".gitignore"
- "Dockerfile"
- "docker-compose.yml"
- "package.json"
- ".dockerignore"
- ".gitignore"
- label: "code"
- '.github'
- '.autorc'
- '.eslintrc'
- '.eslintignore'
- '.prettierrc'
- '.prettierignore'
- '.all-contributorsrc'
- 'environments'
- '.gitignore'
- 'Dockerfile'
- 'docker-compose.yml'
- 'package.json'
- '.dockerignore'
- '.gitignore'
- label: 'code'
files:
- "src"
- 'src'
4 changes: 2 additions & 2 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ jobs:
steps:
- uses: ejhayes/labeler@master
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
with:
action_asset_url: "https://github.com/ejhayes/labeler/releases/latest/download/action.tar.gz"
action_asset_url: 'https://github.com/ejhayes/labeler/releases/latest/download/action.tar.gz'
29 changes: 16 additions & 13 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@ name: Code Review
on:
pull_request:
types: [opened, synchronize]
branches:
- '!next'
branches-ignore:
- main

concurrency:
group: ${{ github.head_ref }}-pr
cancel-in-progress: true

env:
NODE_VERSION: '18'

jobs:
init:
runs-on: ubuntu-latest
Expand All @@ -22,7 +25,7 @@ jobs:
key: modules-${{ hashFiles('package-lock.json') }}
- uses: actions/setup-node@v3
with:
node-version: "18"
node-version: ${{ env.NODE_VERSION }}
- if: steps.cache.outputs.cache-hit != 'true'
run: npm ci

Expand All @@ -40,7 +43,7 @@ jobs:
key: modules-${{ hashFiles('package-lock.json') }}
- uses: actions/setup-node@v3
with:
node-version: "18"
node-version: ${{ env.NODE_VERSION }}
- uses: fossas/fossa-action@main
with:
api-key: ${{ secrets.FOSSA_API_KEY }}
Expand All @@ -51,9 +54,9 @@ jobs:
prettier: true
prettier_extensions: ts,json,js,yml
auto_fix: true
commit_message: "chore(lint): Fix code style issues with ${linter}"
commit_message: 'chore(lint): Fix code style issues with ${linter}'
github_token: ${{ secrets.GITHUB_TOKEN }}
git_email: "[email protected]"
git_email: '[email protected]'

build:
runs-on: ubuntu-latest
Expand All @@ -69,7 +72,7 @@ jobs:
key: modules-${{ hashFiles('package-lock.json') }}
- uses: actions/setup-node@v3
with:
node-version: "18"
node-version: ${{ env.NODE_VERSION }}
- run: npm run ci:build
- env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -89,7 +92,7 @@ jobs:
key: modules-${{ hashFiles('package-lock.json') }}
- uses: actions/setup-node@v3
with:
node-version: "18"
node-version: ${{ env.NODE_VERSION }}
- if: ${{ github.actor != 'dependabot[bot]' }}
uses: paambaati/[email protected]
env:
Expand All @@ -103,7 +106,7 @@ jobs:

test-e2e:
runs-on: ubuntu-latest
needs: [test]
needs: [init]
timeout-minutes: 3
permissions: write-all
env:
Expand All @@ -118,8 +121,8 @@ jobs:
- 8080:8080
env:
DEBUG: 1
STORAGE: "local"
STORAGE_LOCAL_ROOTDIR: "/tmp/charts"
STORAGE: 'local'
STORAGE_LOCAL_ROOTDIR: '/tmp/charts'
PORT: 8080
steps:
- uses: actions/checkout@v4
Expand All @@ -131,7 +134,7 @@ jobs:
key: modules-${{ hashFiles('package-lock.json') }}
- uses: actions/setup-node@v3
with:
node-version: "18"
node-version: ${{ env.NODE_VERSION }}
# e2e dependencies
- name: Setup Helm
uses: azure/setup-helm@v3
Expand All @@ -147,7 +150,7 @@ jobs:
- env:
HELM_PLUGIN_ENABLE_CANARY: true
HELM_PLUGIN_PUSH: true
HELM_PLUGIN_REPOSITORY: "@local"
HELM_PLUGIN_REPOSITORY: '@local'
HELM_PLUGIN_PUBLISH_REPOSITORY: local
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npm run ci:test:e2e
7 changes: 5 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ on:

permissions: write-all

env:
NODE_VERSION: '18'

jobs:
release:
runs-on: ubuntu-latest
Expand All @@ -19,12 +22,12 @@ jobs:
token: ${{ secrets.GH_TOKEN }}
- uses: oleksiyrudenko/[email protected]
with:
token: "${{ secrets.GH_TOKEN }}"
token: '${{ secrets.GH_TOKEN }}'
- name: Prepare repository
run: git fetch --unshallow --tags
- uses: actions/setup-node@v3
with:
node-version: "18"
node-version: ${{ env.NODE_VERSION }}
- name: Cache node modules
uses: actions/cache@v3
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/required_labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ jobs:
with:
mode: minimum
count: 1
labels: "major,minor,patch,skip-release,internal"
labels: 'major,minor,patch,skip-release,internal'
2 changes: 1 addition & 1 deletion .github/workflows/todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ jobs:
uses: ejhayes/tdg-github-action@master
with:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
ACTION_ASSET_URL: "https://github.com/ejhayes/tdg-github-action/releases/latest/download/action.tar.gz"
ACTION_ASSET_URL: 'https://github.com/ejhayes/tdg-github-action/releases/latest/download/action.tar.gz'
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"singleQuote": true,
"trailingComma": "all",
"semi": false,
"tabWidth": 2
}
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# auto-plugin-helm-chartmuseum

[![npm version](https://badge.fury.io/js/auto-plugin-helm-chartmuseum.svg)](https://badge.fury.io/js/auto-plugin-helm-chartmuseum) [![Maintainability](https://api.codeclimate.com/v1/badges/0786ebf1133fdadab59d/maintainability)](https://codeclimate.com/github/ejhayes/auto-plugin-helm-chartmuseum/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/0786ebf1133fdadab59d/test_coverage)](https://codeclimate.com/github/ejhayes/auto-plugin-helm-chartmuseum/test_coverage) [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fejhayes%2Fauto-plugin-helm-chartmuseum.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fejhayes%2Fauto-plugin-helm-chartmuseum?ref=badge_shield) <!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->

<!-- ALL-CONTRIBUTORS-BADGE:END -->

Auto plugin for helm charts! This plugin can do the following:

Expand Down Expand Up @@ -40,6 +41,7 @@ To use in your projects, add this to you `.autorc` file under `plugins` section:
```

### github actions

You can use this with GitHub actions as follows:

```yaml
Expand All @@ -57,7 +59,7 @@ You can use this with GitHub actions as follows:
- env:
HELM_PLUGIN_ENABLE_CANARY: true
HELM_PLUGIN_PUSH: true
HELM_PLUGIN_REPOSITORY: "@local"
HELM_PLUGIN_REPOSITORY: '@local'
HELM_PLUGIN_PUBLISH_REPOSITORY: local
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx auto shipit
Expand Down Expand Up @@ -104,4 +106,4 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d

<!-- ALL-CONTRIBUTORS-LIST:END -->

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
8 changes: 4 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
version: "3"
version: '3'

services:
chartmuseum:
image: ghcr.io/helm/chartmuseum:v0.16.0
ports:
- "8080:8080"
- '8080:8080'
environment:
DEBUG: 1
STORAGE: "local"
STORAGE_LOCAL_ROOTDIR: "/tmp/charts"
STORAGE: 'local'
STORAGE_LOCAL_ROOTDIR: '/tmp/charts'
#volumes:
# - './charts:/charts'
8 changes: 4 additions & 4 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// eslint-disable-next-line no-undef
module.exports = {
collectCoverage: true,
coverageReporters: ["lcov", "text"],
preset: "ts-jest",
testEnvironment: "node",
};
coverageReporters: ['lcov', 'text'],
preset: 'ts-jest',
testEnvironment: 'node',
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"ci:test": "npm run test -- --coverage",
"ci:test:e2e": "npm run test:e2e",
"lint": "eslint .",
"format": "",
"format": "prettier --write .",
"build": "rimraf dist && tsc -p tsconfig.build.json",
"services:start": "docker compose up -d chartmuseum",
"services:stop": "docker compose stop",
Expand Down
Loading

0 comments on commit aa9c14d

Please sign in to comment.