Add hook to sync repo to staging repository
ClosedPublic

Authored by bshah on Jun 27 2018, 1:51 PM.

Details

Summary

Add secondary commit hook for staging repos

very simple logic, is user scmupdate? allow everything, else just
phabricator tags creation

Also don't send out the any notifications at all.

Add phab arcconfig

Test Plan

none so far

Diff Detail

Repository
R248 Repository management
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
bshah requested review of this revision.Jun 27 2018, 1:51 PM
bshah created this revision.
bshah updated this revision to Diff 36772.Jun 27 2018, 3:05 PM

fix comment

bshah added a task: Unknown Object (Maniphest Task).Jun 27 2018, 3:07 PM

Looks good, just a few small things to sort out.

helpers/sync-staging.sh
12

The mirror option to Git, if memory serves, will destroy any refs that don't exist on the system making the push, which is probably not what we want here.

I'd suggest taking a look at the Github replication script, which ignores special Github refs on the remote side, for this.

hooks/update.secondary.staging
54

Leftover from original script?

55

Shouldn't this be and? Otherwise only scmsync will be able to push.

bshah updated this revision to Diff 36807.Jun 28 2018, 6:11 AM
bshah marked 2 inline comments as done.
  • Adjust how we mirror changes
  • Fix logic error
  • Remove leftover stuff
bshah marked an inline comment as done.Jun 28 2018, 6:11 AM
bshah updated this revision to Diff 36812.Jun 28 2018, 7:26 AM
  • Add script to sync to staging repo
This revision was not accepted when it landed; it landed in state Needs Review.Jun 28 2018, 7:27 AM
This revision was automatically updated to reflect the committed changes.
bshah reopened this revision.Jun 28 2018, 9:33 AM
bshah updated this revision to Diff 36818.Jun 28 2018, 9:33 AM
  • Revert "Add script to sync to staging repo"
bcooksley added inline comments.Jun 28 2018, 9:48 AM
hooks/update.secondary.staging
54

Sorry, one more thing I missed...

repository.ref_name is a little bit special in that it's the name of the branch/tag/etc which has been created, with repository.ref_type containing the type of ref (tag, branch, etc) which was changed.

bshah marked an inline comment as done.Jun 28 2018, 10:01 AM
bshah updated this revision to Diff 36823.Jun 28 2018, 10:03 AM
  • if user is not scmsync, allow only phabricator tag
bshah updated this revision to Diff 36824.Jun 28 2018, 10:32 AM
  • only mainline repos in staging
This revision was not accepted when it landed; it landed in state Needs Review.Jun 28 2018, 11:33 AM
This revision was automatically updated to reflect the committed changes.