Skip to content

Bug: 5-rename-directory pipeline incorrectly writes Dataverse/Zenodo IDs into openicpsr field #74

@larsvilhuber

Description

@larsvilhuber

Problem

The 5-rename-directory pipeline in bitbucket-pipelines.yml unconditionally writes the new directory name into the openicpsr: field of config.yml, regardless of the repository type.

Root Cause

In bitbucket-pipelines.yml lines 330-351, the rename pipeline:

  1. Sets export openICPSRID=$newName (line 346)
  2. Calls ./tools/update_config.sh
  3. Which writes openICPSRID into the openicpsr: field

This assumes all directories are openICPSR projects, but repositories can also be:

  • Dataverse (prefix: dv-DVN-)
  • Zenodo (prefix: zenodo-)
  • OSF repositories

Example

When renaming a directory to dv-DVN-PTBWZT, the pipeline incorrectly creates:

openicpsr: dv-DVN-PTBWZT
dataverse: 

Instead of:

openicpsr: 
dataverse: dv-DVN-PTBWZT

Proposed Fix

The pipeline should detect the identifier type based on the directory name prefix and set the appropriate environment variable:

# Detect repository type and set appropriate variable
if [[ $newName =~ ^dv- ]]; then
  export DataverseID=$newName
elif [[ $newName =~ ^zenodo- ]]; then
  export ZenodoID=$newName
elif [[ $newName =~ ^osf- ]]; then
  export OSFID=$newName
else
  export openICPSRID=$newName
fi

Impact

This causes incorrect repository metadata in config.yml, which can affect downstream processing and reporting.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions