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

[drone] secrets can contain invalid characters #107

Closed
jimsheldon opened this issue Jun 12, 2023 · 1 comment
Closed

[drone] secrets can contain invalid characters #107

jimsheldon opened this issue Jun 12, 2023 · 1 comment
Assignees
Labels
bug Something isn't working drone Drone conversion target

Comments

@jimsheldon
Copy link
Contributor

Drone secrets can contain characters such as hyphens, which are not allowed for secrets in Harness CI.

For example, this is a valid Drone pipeline:

kind: pipeline
type: docker
name: default

steps:
- name: slack
  image: plugins/slack
  settings:
    webhook:
      from_secret: MY-SLACK-WEBHOOK

In Harness CI, we must translate invalid characters to a valid character, such as _.

The above yaml should translate to this v1 Harness CI yaml:

options: {}
stages:
- name: default
  spec:
    clone: {}
    runtime:
      spec: {}
      type: machine
    steps:
    - name: slack
      spec:
        image: plugins/slack
        with:
          webhook: <+ secrets.getValue("MY_SLACK_WEBHOOK") >
      type: plugin
  type: ci

We should verify what characters are valid (likely [a-zA-Z0-9_]) in Harness CI yaml, and handle converting them to a safe character (likely _).

When this work is done, we will need a follow-up in harness-migrate to do the same conversion when reading secrets from the Drone database.

@jimsheldon jimsheldon added drone Drone conversion target bug Something isn't working labels Jun 12, 2023
@jimsheldon
Copy link
Contributor Author

Fixe in #108

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working drone Drone conversion target
Projects
None yet
Development

No branches or pull requests

2 participants