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

Update workflow-support #1422

Merged
merged 1 commit into from
Aug 26, 2022
Merged

Update workflow-support #1422

merged 1 commit into from
Aug 26, 2022

Conversation

jglick
Copy link
Member

@jglick jglick commented Aug 25, 2022

https://github.com/jenkinsci/workflow-support-plugin/releases/tag/838.va_3a_087b_4055b has not appeared in https://github.com/jenkinsci/bom/network/updates/446183713

updater | INFO <job_446183713> Checking if org.jenkins-ci.plugins.workflow:workflow-support 833.va_1c71061486b_ needs updating
  proxy | 2022/08/25 14:17:36 [188] GET https://repo.jenkins-ci.org:443/public/org/jenkins-ci/jenkins/1.85/jenkins-1.85.pom
  proxy | 2022/08/25 14:17:37 [188] 200 https://repo.jenkins-ci.org:443/public/org/jenkins-ci/jenkins/1.85/jenkins-1.85.pom
  proxy | 2022/08/25 14:17:37 [190] GET https://repo.jenkins-ci.org:443/public/org/jenkins-ci/plugins/workflow/workflow-support/maven-metadata.xml
  proxy | 2022/08/25 14:17:37 [190] 200 https://repo.jenkins-ci.org:443/public/org/jenkins-ci/plugins/workflow/workflow-support/maven-metadata.xml
  proxy | 2022/08/25 14:17:37 [192] GET https://repo.maven.apache.org:443/maven2/org/jenkins-ci/plugins/workflow/workflow-support/maven-metadata.xml
  proxy | 2022/08/25 14:17:37 [192] 404 https://repo.maven.apache.org:443/maven2/org/jenkins-ci/plugins/workflow/workflow-support/maven-metadata.xml
  proxy | 2022/08/25 14:17:37 [194] HEAD https://repo.jenkins-ci.org:443/public/org/jenkins-ci/plugins/workflow/workflow-support/833.va_1c71061486b_/workflow-support-833.va_1c71061486b_.jar
  proxy | 2022/08/25 14:17:37 [194] 200 https://repo.jenkins-ci.org:443/public/org/jenkins-ci/plugins/workflow/workflow-support/833.va_1c71061486b_/workflow-support-833.va_1c71061486b_.jar
updater | INFO <job_446183713> Latest version is 833.va_1c71061486b_
updater | INFO <job_446183713> No update needed for org.jenkins-ci.plugins.workflow:workflow-support 833.va_1c71061486b_

despite

$ curl -s https://repo.jenkins-ci.org:443/public/org/jenkins-ci/plugins/workflow/workflow-support/maven-metadata.xml | fgrep release
    <release>838.va_3a_087b_4055b</release>

Not sure why. Perhaps jenkinsci/incrementals-tools#31 was mistaken?

Anyway, need to release jenkinsci/workflow-support-plugin#188 for e.g. jenkinsci/pipeline-stage-step-plugin#70.

@jglick jglick added the developer Pull requests that merits a release for plugin developers label Aug 25, 2022
@jglick jglick requested review from basil, timja and jetersen August 25, 2022 14:26
@basil basil enabled auto-merge (squash) August 25, 2022 15:21
@basil
Copy link
Member

basil commented Aug 25, 2022

Not sure why

For what it's worth, I had success at one point running the Dependabot Ruby code (not a language I had ever programmed in before) in Visual Studio Code (not a program I had ever used before) to step through the logic in question and see why it wasn't picking the version it should be picking.

I seem to have subconsciously purged any memory of this event from my mind, but my Git commit history shows the following:

diff --git a/.vscode/launch.json b/.vscode/launch.json
new file mode 100644
index 0000000..c81dc0d
--- /dev/null
+++ b/.vscode/launch.json
@@ -0,0 +1,20 @@
+{
+    // Use IntelliSense to learn about possible attributes.
+    // Hover to view descriptions of existing attributes.
+    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
+    "version": "0.2.0",
+    "configurations": [
+        {
+            "name": "Debug Local File",
+            "type": "Ruby",
+            "request": "launch",
+            "program": "${workspaceRoot}/generic-update-script.rb",
+            "useBundler": true,
+            "env": {
+                "PROJECT_PATH": "basil/bom",
+                "PACKAGE_MANAGER": "maven",
+                "GITHUB_ACCESS_TOKEN": "<redacted>"
+            }
+        }
+    ]
+}
\ No newline at end of file
diff --git a/Gemfile b/Gemfile
index 0308408..766c373 100644
--- a/Gemfile
+++ b/Gemfile
@@ -3,4 +3,6 @@
 source "https://rubygems.org"
 
 gem "irb"
+gem "debase"
 gem "dependabot-omnibus", "~> 0.209.0"
+gem "ruby-debug-ide"
diff --git a/generic-update-script.rb b/generic-update-script.rb
index 2449f81..dcf44ab 100644
--- a/generic-update-script.rb
+++ b/generic-update-script.rb
@@ -174,6 +174,8 @@ parser = Dependabot::FileParsers.for_package_manager(package_manager).new(
 dependencies = parser.parse
 
 dependencies.select(&:top_level?).each do |dep|
+  next if dep.name != "org.jenkins-ci.plugins:structs"
+
   #########################################
   # Get update details for the dependency #
   #########################################
@@ -214,41 +216,7 @@ dependencies.select(&:top_level?).each do |dep|
   )
 
   updated_files = updater.updated_dependency_files
-
-  ########################################
-  # Create a pull request for the update #
-  ########################################
-  assignee = (ENV["PULL_REQUESTS_ASSIGNEE"] || ENV["GITLAB_ASSIGNEE_ID"])&.to_i
-  assignees = assignee ? [assignee] : assignee
-  pr_creator = Dependabot::PullRequestCreator.new(
-    source: source,
-    base_commit: commit,
-    dependencies: updated_deps,
-    files: updated_files,
-    credentials: credentials,
-    assignees: assignees,
-    author_details: { name: "Dependabot", email: "no-reply@github.com" },
-    label_language: true,
-  )
-  pull_request = pr_creator.create
-  puts " submitted"
-
-  next unless pull_request
-
-  # Enable GitLab "merge when pipeline succeeds" feature.
-  # Merge requests created and successfully tested will be merge automatically.
-  if ENV["GITLAB_AUTO_MERGE"]
-    g = Gitlab.client(
-      endpoint: source.api_endpoint,
-      private_token: ENV["GITLAB_ACCESS_TOKEN"]
-    )
-    g.accept_merge_request(
-      source.repo,
-      pull_request.iid,
-      merge_when_pipeline_succeeds: true,
-      should_remove_source_branch: true
-    )
-  end
+  foo = "bar"
 end
 
 puts "Done"
-- 

@basil basil merged commit ab292c3 into jenkinsci:master Aug 26, 2022
@jglick jglick deleted the workflow-support branch August 29, 2022 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
developer Pull requests that merits a release for plugin developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants