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

Accept 0.8 tokens #2713

Closed
bradrydzewski opened this issue May 22, 2019 · 5 comments
Closed

Accept 0.8 tokens #2713

bradrydzewski opened this issue May 22, 2019 · 5 comments
Milestone

Comments

@bradrydzewski
Copy link

See if we can accept 0.8 tokens with 1.0 to simplify the transition for teams that are upgrading

@bradrydzewski
Copy link
Author

bradrydzewski commented May 30, 2019

@jimsheldon I am brainstorming a fix for this. I was thinking maybe we find / replace secrets in the database to update tokens automatically. This would ensure pipelines using drone tokens would continue to work in 1.0 without modification. This would not solve the broader compatibility issue, for example, people using their tokens with drone-cli would still need to update. Wondering if this would be an acceptable compromise or not?

Do you know how many repositories this impacts? And do you know if projects using Drone tokens follow some sort of naming convention (e.g. drone_token)? Thoughts on proposed solution?

@jimsheldon
Copy link
Contributor

I think drone tokens are used very little in drone pipelines, they are more used by external processes like kubernetes cron jobs (I think some teams even trigger jobs in drone from TravisCI and CircleCI).

If the tokens can't come over from 0.8 as-is, I think we would be ok with that. We would just have to communicate this to our users ahead of time.

@bradrydzewski
Copy link
Author

thanks for the reply. I have some other approaches that I can consider

@bradrydzewski bradrydzewski added this to the v.1.3.0 milestone May 30, 2019
@bradrydzewski
Copy link
Author

bradrydzewski commented Jun 6, 2019

as a workaround to simplify migration, it is possible to provide drone 1.0 with a file that maps legacy secrets to users. This allows the system to accept 0.8 tokens. The file format is the following:

{
  "octocat": "cCI6IkpXVCJ...",
  "spaceghost": "NiIsInR5cC..."
}

The file path is passed to the drone server using the DRONE_LEGACY_TOKEN_MAPPING_FILE environment variable. For example:

docker run \
 --volume=/etc/drone/mapping.json:/etc/drone/mapping.json \
 --env=DRONE_LEGACY_TOKEN_MAPPING_FILE=/etc/drone/mapping.json \

I will update the migration utility to generate the mapping file automatically.

@bradrydzewski
Copy link
Author

this is merged in master and will be part of a 1.2.1 release that I plan to cut tomorrow, along with a few other fixes related to yaml migration.

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

No branches or pull requests

2 participants