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

Building a forked master branch results in publishing artifacts #531

Closed
CharliePoole opened this issue Jan 10, 2019 · 4 comments
Closed
Assignees
Labels
Milestone

Comments

@CharliePoole
Copy link
Collaborator

This came as a surprise to me when it happened, but it makes perfect sense.

If you

  1. Fork nunit-console and
  2. Set it up to build on AppVeyor and
  3. Build your master branch and
  4. The build succeeds

Then
5. The resulting artifacts are published to the NUnit myget stream.

Well, of course they are! The only test is on the name of the branch and the token is right there in the appveyor.yml file. I should have expected this.

Aside from the obvious problems of unwanted changes being published, the version numbering is completely off because it uses the Appveyor job number from the originating account.

I guess this could be dealt with in two ways...

  1. Just change the logic so the name of the account is checked as well as the branch. This might require putting it into build.cake or maybe some logic can be added to the yml.

  2. Think seriously about getting the access token out of the yml entirely.

I need to figure out what to do in my fork as well, because I'd like to publish to the TestCentric feed for consumption by TestCentric, at least until such time as some fixes get into the engine. If I come up with an approach that will work more generally, I'll post here.

@CharliePoole
Copy link
Collaborator Author

Thinking about it... this is probably not a general problem. For most people forking an NUnit project, I would expect the deployment to fail.

@CharliePoole
Copy link
Collaborator Author

To keep it from happening again, I modified appveyor.yml on my fork.

Also posed a question about this on the support forum.

@ChrisMaddock
Copy link
Member

I was going to ask - is this just because your personal appveyor account is authorised to post to myget? This isn’t the case for all contributors, right?

@CharliePoole
Copy link
Collaborator Author

I thought that might be it but according to my conversation with AppVeyor support, it's because I created both AppVeyor projects! He says that it wouldn't deploy for anybody else's project.

Since this is a one-off thing, it's probably not a big worry but I have a patch we can add to the build script so it only deploys when being run under nunit/nunit-console. I'll post it shortly and we can merge if it doesn't seem like too much overkill.

However, since I appear to be the only person who can cause this bug to appear, it might be enough if I just stop doing it. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants