sealerio/sealer

vendor upstream package instead of copying upstream pkg's file directly to sealer's code

オープン

#1,506 opened on 2022/06/13

 (0 件のコメント) (0 件のリアクション) (0 人の担当者)Go (357 件のフォーク)github user discovery
help wantedkind/feature

Repository metrics

Stars
 (2,096 個のスター)
PR merge metrics
 (30d に merged PR はありません)

説明

When I was learning sealer's source code, almost all of sealer's code is quite high-quality, especially the design part. While there is still something which could be improved, in my opinion.

vendor upstream pkg instead of directly copying to repo may be the part that we could improve.

We know that directly copying upstream file is quite convenient when coding. While it may bring some other side-effect:

  • lose the track of current file and upstream file;
  • make others confuse that if it is a direct copy from upstream or hacker added some customized code there. In result, the maintain effort of that file could be quite huge.
  • the version control of that file is quite difficult.

Here are some examples that I use grep The Kubernetes Authors. which means the file is copied from somewhere else:

  • go/src/github.com/sealerio/sealer/pkg/debug/resize.go
  • go/src/github.com/sealerio/sealer/pkg/debug/resizeevents.go
  • go/src/github.com/sealerio/sealer/pkg/debug/term..go
  • go/src/github.com/sealerio/sealer/pkg/runtime/kubeadm_types/v1beta2/types.go which is related to some issue https://github.com/sealerio/sealer/issues/1484

If they are just copied from upstream, I wish to vendor them within go vendor packages policies.

コントリビューターガイド