#681  HTTP 500 when viewing imported .onedev-buildspec.yml
Released
John opened 2 years ago

Steps to reproduce:

  1. Create project A and create a .onedev-buildspec.yml containing step templates
  2. Create a tag for the current version of the .onedev-buildspec.yml file, in order to be imported into other projects
  3. Create project B and create a .onedev-buildspec.yml that just imports the .onedev-buildspec.yml file created in step #1
  4. Save and commit the .onedev-buildspec.yml file created in step #3
  5. Click on the .onedev-buildspec.yml file in the file list view of project B and get "OOPS! There Is An Error" (HTTP 500)

project A buildspec:

version: 15
jobs:
- name: lint
  steps:
  - !UseTemplateStep
    name: lint
    templateName: lint-template
    condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
  triggers:
  - !BranchUpdateTrigger {}
  - !ScheduleTrigger
    cronExpression: 0 0 5 ? * 2
  retryCondition: never
  maxRetries: 3
  retryDelay: 30
  cpuRequirement: 500
  memoryRequirement: 256
  timeout: 3600
  postBuildActions:
  - !RunJobAction
    condition: successful
    jobName: build
- name: build
  steps:
  - !UseTemplateStep
    name: build
    templateName: docker-template
    condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
  retryCondition: '"Log" contains "retry" or "Log" contains "Retrying" or "Log" contains
    "temporary error"'
  maxRetries: 3
  retryDelay: 30
  cpuRequirement: 500
  memoryRequirement: 256
  timeout: 3600
stepTemplates:
- name: docker-template
  steps:
  - !CheckoutStep
    name: checkout
    cloneCredential: !DefaultCredential {}
    withLfs: false
    withSubmodules: false
    condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
  - !CommandStep
    name: lint
    runInContainer: true
    image: acme/linter:latest
    interpreter: !DefaultInterpreter
      commands:
      - set -e
      - find . -maxdepth 2 -type f -name '*.sh' -exec shellcheck {} \+
      - find . -maxdepth 2 -type f -name '*.yml' -name '*.yaml' -exec yamllint {}
        \+
      - find . -maxdepth 2 -type f -name 'Dockerfile' -exec hadolint {} \+
      - find . -maxdepth 2 -type f -name '*.py' -exec black --check --diff {} \+
      - find . -maxdepth 2 -type f -name '*.py' -exec pylint -d missing-docstring,import-error,no-self-use,bad-continuation
        {} \+
    useTTY: true
    condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
  - !BuildImageStep
    name: build
    tags: acme/@project_path@:latest
    publish: true
    condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
- name: lint-template
  steps:
  - !CheckoutStep
    name: checkout
    cloneCredential: !DefaultCredential {}
    withLfs: false
    withSubmodules: false
    condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
  - !CommandStep
    name: lint
    runInContainer: true
    image: acme/linter:latest
    interpreter: !DefaultInterpreter
      commands:
      - set -e
      - find . -maxdepth 2 -type f -name '*.sh' -exec shellcheck {} \+
      - find . -maxdepth 2 -type f -name '*.yml' -name '*.yaml' -exec yamllint {}
        \+
      - find . -maxdepth 2 -type f -name 'Dockerfile' -exec hadolint {} \+
      - find . -maxdepth 2 -type f -name '*.py' -exec black --check --diff {} \+
      - find . -maxdepth 2 -type f -name '*.py' -exec pylint -d missing-docstring,import-error,no-self-use,bad-continuation
        {} \+
    useTTY: true
    condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL

project B buildspec:

version: 15
imports:
- projectPath: acme/linter
  tag: v7
OneDev changed state to 'Closed' 2 years ago
Previous Value Current Value
Open
Closed
OneDev commented 2 years ago

State changed as code fixing the issue is committed

OneDev changed state to 'Released' 2 years ago
Previous Value Current Value
Closed
Released
OneDev commented 2 years ago

State changed as build #2533 is successful

issue 1 of 1
Type
Bug
Priority
Normal
Assignee
Affected Versions
Not Found
Issue Votes (0)
Watchers (4)
Reference
onedev/server#681
Please wait...
Page is in error, reload to recover