WIP: feature/installcheck #99
Reference in New Issue
Block a user
No description provided.
Delete Branch "atartamo/autogits:feature/installcheck"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Thanks for the PR. Just a few nit-picks mosly and the regex missing the
.@@ -276,0 +278,4 @@}type InstallcheckConfig struct {Repos map[string][]string `json:"repos"`This needs documentation. This probably needs to be extended
https://src.opensuse.org/git-workflow/autogits/src/branch/main/obs-staging-bot#configuration-file
Need example of how these things are defined. map of what to what.
stringis not very descriptive here.@@ -283,1 +292,4 @@QA []QAConfigRepositories map[string]RepositoryConfig `json:",omitempty"`Installcheck InstallcheckConfig `json:",omitempty"`pointer here, *InstallcheckConfig, would be omitted if empty.
map[string]*RepositoryConfig
@@ -0,0 +15,4 @@* PARTICULAR PURPOSE. See the GNU General Public License for more details.** You should have received a copy of the GNU General Public License along with* Foobar. If not, see <https://www.gnu.org/licenses/>.Foobar? :-)
@@ -0,0 +6,4 @@"strings")// ParseSubprojectChangesFromDiff parses a diff string and returns a slice of package names that have changed.should be
not packages, repositories. For packages we need to parser the .gitmoduels and substitute the submodule mount point to repo name.
fortunately only few exceptions here, like the packages with
+@@ -0,0 +13,4 @@// This regex finds diff chunks for subprojects.// It looks for a `diff --git` line, followed by lines indicating a subproject commit change.re := regexp.MustCompile(`diff --git a\/(.+) b\/(.+)\n`)This probably needs
^and$to mark the front end end of the line.@@ -0,0 +28,4 @@const SkipSrcRpm = truefunc ParseNotificationToPR(thread *models.NotificationThread) (org string, repo string, num int64, err error) {rx := regexp.MustCompile(`^https://src\.(?:open)?suse\.(?:org|de)/api/v\d+/repos/(?<org>[-_a-zA-Z0-9]+)/(?<project>[-_a-zA-Z0-9]+)/issues/(?<num>[0-9]+)$`)Need to add
\.to the org and project names, in case those have a . in them.^https://src\.(?:open)?suse\.(?:org|de)/api/v\d+/repos/(?<org>[-\._a-zA-Z0-9]+)/(?<project>[-\._a-zA-Z0-9]+)/issues/(?<num>[0-9]+)$maybe better, this duplication from the staging bot can be put as a const in
common/consts.goand references from both places.TODO: this could be a URL parser and just fetch parts of the path as org, project and issue number.
@@ -0,0 +230,4 @@changedPackages := common.ParseSubprojectChangesFromDiff(diff)if len(changedPackages) > 0 {common.LogInfo("Changed packages found in PR!")Here we already have this functionality not by parsing a diff, but at looking at changes to the submodules. But maybe this is better if subdirectories need to be taken into account.
(so nothing to change here, just a comment)
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.