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

OBSOLETE - [HOWTO] Automatic transfer of packs #7

Open
emedvedev opened this issue Feb 16, 2017 · 7 comments
Open

OBSOLETE - [HOWTO] Automatic transfer of packs #7

emedvedev opened this issue Feb 16, 2017 · 7 comments

Comments

@emedvedev
Copy link
Contributor

emedvedev commented Feb 16, 2017

Once a pull request is reviewed and merged, the following needs to happen:

  1. An empty repository should be bootstrapped in the StackStorm-Exchange org with exchange-bootstrap.sh.

  2. The submitted pack should be transferred into that repository in one of the two ways:

  • as a new commit, if the pack has been submitted as a dir;
  • as a merge with --allow-unrelated-histories if the pack has been submitted as a submodule and has git history.
  1. The submitted pack should be removed from this repository once the transfer is complete and verified (automatically).

exchange-bootstrap.sh takes care of the CI, builds, and index updates, so the pack should automatically get to the Exchange index after the correct transfer, given it doesn't have linting errors (#6).

@emedvedev
Copy link
Contributor Author

emedvedev commented Feb 21, 2017

To give a complete example, here's how to transfer https://github.com/StackStorm/st2-mysql to the Exchange:

  1. Run the bootstrap script with the necessary env variables (URL and CIRCLECI_TOKEN are in 1Password):
$ export SLACK_WEBHOOK_URL=XXX
$ export CIRCLECI_TOKEN=XXX
$ export GITHUB_USERNAME=stackstorm-neptr
$ export GITHUB_TOKEN=XXX
# in your checkout of the ci repo:
$ utils/exchange-bootstrap.sh mysql

This will create the StackStorm-Exchange/stackstorm-mysql repository and configure CircleCI for it.

  1. Clone the Exchange repository, and add the source repository as a remote:
$ git clone https://github.com/StackStorm-Exchange/stackstorm-mysql
$ cd stackstorm-mysql/
$ git remote add source https://github.com/stackstorm/st2-mysql
  1. Create a branch for the transfer and fetch sources:
$ git checkout -b transfer
$ git fetch source
  1. Pull to the transfer branch from the master branch of the source and resolve merge conflicts if they appear:
$ git pull source master --allow-unrelated-histories
// Automatic merge failed because of .gitignore; fix conflicts and then commit the result.
$ vim .gitignore
$ git add .gitignore
$ git commit -am 'Transfer the pack from StackStorm/st2-mysql'
  1. Push to GitHub:
$ git push origin transfer
  1. After the branch is uploaded to GitHub, create a pull request and fix linting errors (there will be linting errors):

StackStorm-Exchange/stackstorm-mysql#1

  1. Merge. You are awesome!

  2. Once the deploy CI workflow succeeds to update the index, give the pack author write access to the repo.

@LindsayHill

This comment has been minimized.

@emedvedev

This comment has been minimized.

@LindsayHill

This comment has been minimized.

@arm4b arm4b pinned this issue Jul 19, 2019
@arm4b arm4b changed the title Automatic transfer of packs [HOWTO] Automatic transfer of packs Jul 19, 2019
@nmaludy nmaludy unpinned this issue Jul 31, 2020
@arm4b arm4b pinned this issue Oct 27, 2020
@cognifloyd
Copy link
Member

cognifloyd commented Sep 21, 2021

I edited the previous instructions to show the current required variables for the exchange-bootstrap.sh script.

WIP below this point...

If someone submits a pack as a submodule to the exchange-incubator, use the instructions above: #7 (comment)

If someone submits a pack as a subdirectory in a PR, then we need to use a slightly different process (mostly steps 3 and 4).

  1. Bootstrap the exchange repo (see the other instructions for an example; this step is the same).
  2. Clone the Exchange repository, and add the incubator repository as a remote:
$ git clone https://github.com/StackStorm-Exchange/stackstorm-mysql
$ cd stackstorm-mysql/
$ git remote add incubator https://github.com/StackStorm-Exchange/exchange-incubator
  1. Create a branch for the transfer, and fetch the pull request (use the correct PR number! 7 is the number of this issue.):
$ git checkout -b transfer
$ git fetch incubator pull/7/head
  1. When there is only one commit, cherry-pick, resolve conflicts, and amend the commit (for multiple commits, look into using the tools/split-packs.sh script):
$ git cherry-pick 989fe28cd05df43bf0b03639eca1624dabc7e7d7
$ git mv mysql/* ./
# drop unnecessary execute bits
$ chmod -x *.md *.yaml *.example *.txt *.png
# fix any conflicts
$ git diff
$ vim .gitignore
$ git add .gitignore
$ git commit --amend
# add a note saying "Transferred from: <URL to incubator PR>"
  1. Push to GitHub:
$ git push origin transfer
  1. After the branch is uploaded to GitHub, create a pull request and fix linting errors (there will be linting errors):

StackStorm-Exchange/stackstorm-mysql#1

  1. Merge. You are awesome!

  2. Once the deploy CI workflow succeeds to update the index, give the pack author write access to the repo.

@cognifloyd cognifloyd changed the title [HOWTO] Automatic transfer of packs OBSOLETE - [HOWTO] Automatic transfer of packs May 21, 2022
@cognifloyd
Copy link
Member

Now that we have a bootstrap pack workflow (triggered with !bootstrap pack comment on an approved incubator PR) added in #172, the instructions here are out-of-date. So, I'm closing this.

Note: the logic in #172 came in part from these instructions. But now it's a lot less tedious 😉.

@arm4b
Copy link
Member

arm4b commented May 21, 2022

We need just very minimal instructions about the new behavior.

Adding the !bootstrap pack step in the https://github.com/StackStorm-Exchange/exchange-incubator README would be sufficient to replace this issue with something.

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

5 participants