@spotify/backstage-plugin-soundcheck-backend-module-github 0.6.5 → 0.6.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @spotify/backstage-plugin-soundcheck-backend-module-github
2
2
 
3
+ ## 0.6.6
4
+
5
+ ### Patch Changes
6
+
7
+ - Update to Backstage `v1.34.0`
8
+ - Added GitHub `BranchRules` fact type (returns all active rules that apply to the specified branch).
9
+ - Updated dependencies
10
+ - @spotify/backstage-plugin-soundcheck-common@0.14.5
11
+ - @spotify/backstage-plugin-soundcheck-node@0.8.6
12
+
3
13
  ## 0.6.5
4
14
 
5
15
  ### Patch Changes
@@ -1,2 +1,2 @@
1
- "use strict";var C=require("@backstage/catalog-model"),g=require("@backstage/integration"),E=require("@octokit/rest"),a=require("@spotify/backstage-plugin-soundcheck-common"),v=require("@spotify/backstage-plugin-soundcheck-node"),F=require("git-url-parse"),S=require("zod-to-json-schema"),b=require("../extractors/BranchProtectionsFactExtractor.cjs.js"),x=require("../extractors/config/GithubFactCollectorSchema.cjs.js"),R=require("../extractors/ExtractorService.cjs.js"),q=require("../extractors/helper/BranchHelper.cjs.js"),D=require("../extractors/RepositoryDetailsFactExtractor.cjs.js"),P=require("../extractors/RepositoryLanguagesFactExtractor.cjs.js"),k=require("../extractors/store/GithubExtractorsStore.cjs.js");function d(s){return s&&typeof s=="object"&&"default"in s?s:{default:s}}var G=d(F),U=d(S);class u{static ID="github";#e;#a;#i;#r;#t;static create(t,e,i){return new u(t,e,i)}id=u.ID;name="GitHub";description="Collects facts about your GitHub repositories.";constructor(t,e,i){this.#e=e.child({target:this.id}),this.#a=g.ScmIntegrations.fromConfig(t),this.#i=g.DefaultGithubCredentialsProvider.fromIntegrations(this.#a),this.#r=R.ExtractorService.create({logger:this.#e,cache:i.getClient(),branchHelper:q.BranchHelper.create(this.#e,i.getClient({defaultTtl:60*60*1e3})),factories:[b.BranchProtectionsFactExtractor.factory,D.RepositoryDetailsFactExtractor.factory,P.RepositoryLanguagesFactExtractor.factory]}),this.#t=k.GithubExtractorsStore.create(this.#e)}async collect(t,e){const i=e?.factRefs??this.#t.getExtractorConfigs().map(r=>a.getFactRef(this.id,r));return Promise.all(t.filter(r=>a.isScmEntity(r)).map(async r=>{const o=C.stringifyEntityRef(r),l=a.getEntityScmUrl(r),y=G.default(l),f=await this.getOctokit(l);return f?Promise.all(i.map(async n=>{const h=a.parseFactRef(n,{defaultSource:this.id,defaultScope:a.DEFAULT_SCOPE}),p=this.#t.getExtractorConfig(h.name),m=!!e?.refresh?.map(c=>a.stringifyFactRef(c))?.includes(a.stringifyFactRef(n));return this.#r.extract(p,h.scope,y,f,m).then(c=>{if(c!==void 0)return a.buildFact(o,n,c)}).catch(c=>{if(c instanceof v.RateLimitError)throw c;return this.#e.error(`Failed to collect ${a.stringifyFactRef(n)} fact data for ${o} entity: ${c}`),a.buildCollectionError(o,n,c)})})):Promise.resolve()})).then(r=>r.flat().filter(o=>!!o))}async getOctokit(t){try{const{token:e}=await this.#i.getCredentials({url:t}),i=this.#a.github.byUrl(t);return new E.Octokit({auth:e,baseUrl:i?.config.apiBaseUrl})}catch(e){this.#e.warn(`Skipping Github fact collection for url ${t}: ${e}`);return}}async getCollectionConfigs(){return a.buildCollectionConfigs(this.id,this.#t.getExtractorConfigs())}async getFactNames(){const t=this.#r.listFactTypes(),e=this.#t.getExtractorConfigs();return t.flatMap(i=>e.filter(r=>r.type===i).map(r=>r.factName??r.type)??i)}async getDataSchema(t){const e=a.parseFactRef(t,{defaultSource:this.id,defaultScope:a.DEFAULT_SCOPE}),i=this.#t.getExtractorConfigs().find(r=>{const o=a.parseFactRef(a.getFactRef(this.id,r));return e.source===o.source&&e.name===o.name});if(i)return this.#r.getDataSchema(i)}async getConfig(){return this.#t.getConfig()}async setConfig(t){this.#t.setConfig(t)}async getConfigSchema(){return JSON.stringify(U.default(x.GithubFactCollectorSchema))}}exports.GithubFactCollector=u;
1
+ "use strict";var C=require("@backstage/catalog-model"),g=require("@backstage/integration"),E=require("@octokit/rest"),a=require("@spotify/backstage-plugin-soundcheck-common"),v=require("@spotify/backstage-plugin-soundcheck-node"),F=require("git-url-parse"),S=require("zod-to-json-schema"),b=require("../extractors/BranchProtectionsFactExtractor.cjs.js"),x=require("../extractors/BranchRulesFactExtractor.cjs.js"),R=require("../extractors/config/GithubFactCollectorSchema.cjs.js"),q=require("../extractors/ExtractorService.cjs.js"),D=require("../extractors/helper/BranchHelper.cjs.js"),P=require("../extractors/RepositoryDetailsFactExtractor.cjs.js"),k=require("../extractors/RepositoryLanguagesFactExtractor.cjs.js"),G=require("../extractors/store/GithubExtractorsStore.cjs.js");function d(s){return s&&typeof s=="object"&&"default"in s?s:{default:s}}var U=d(F),B=d(S);class u{static ID="github";#r;#a;#i;#e;#t;static create(t,r,i){return new u(t,r,i)}id=u.ID;name="GitHub";description="Collects facts about your GitHub repositories.";constructor(t,r,i){this.#r=r.child({target:this.id}),this.#a=g.ScmIntegrations.fromConfig(t),this.#i=g.DefaultGithubCredentialsProvider.fromIntegrations(this.#a),this.#e=q.ExtractorService.create({logger:this.#r,cache:i.getClient(),branchHelper:D.BranchHelper.create(this.#r,i.getClient({defaultTtl:60*60*1e3})),factories:[b.BranchProtectionsFactExtractor.factory,x.BranchRulesFactExtractor.factory,P.RepositoryDetailsFactExtractor.factory,k.RepositoryLanguagesFactExtractor.factory]}),this.#t=G.GithubExtractorsStore.create(this.#r)}async collect(t,r){const i=r?.factRefs??this.#t.getExtractorConfigs().map(e=>a.getFactRef(this.id,e));return Promise.all(t.filter(e=>a.isScmEntity(e)).map(async e=>{const o=C.stringifyEntityRef(e),l=a.getEntityScmUrl(e),y=U.default(l),f=await this.getOctokit(l);return f?Promise.all(i.map(async n=>{const h=a.parseFactRef(n,{defaultSource:this.id,defaultScope:a.DEFAULT_SCOPE}),p=this.#t.getExtractorConfig(h.name),m=!!r?.refresh?.map(c=>a.stringifyFactRef(c))?.includes(a.stringifyFactRef(n));return this.#e.extract(p,h.scope,y,f,m).then(c=>{if(c!==void 0)return a.buildFact(o,n,c)}).catch(c=>{if(c instanceof v.RateLimitError)throw c;return this.#r.error(`Failed to collect ${a.stringifyFactRef(n)} fact data for ${o} entity: ${c}`),a.buildCollectionError(o,n,c)})})):Promise.resolve()})).then(e=>e.flat().filter(o=>!!o))}async getOctokit(t){try{const{token:r}=await this.#i.getCredentials({url:t}),i=this.#a.github.byUrl(t);return new E.Octokit({auth:r,baseUrl:i?.config.apiBaseUrl})}catch(r){this.#r.warn(`Skipping Github fact collection for url ${t}: ${r}`);return}}async getCollectionConfigs(){return a.buildCollectionConfigs(this.id,this.#t.getExtractorConfigs())}async getFactNames(){const t=this.#e.listFactTypes(),r=this.#t.getExtractorConfigs();return t.flatMap(i=>r.filter(e=>e.type===i).map(e=>e.factName??e.type)??i)}async getDataSchema(t){const r=a.parseFactRef(t,{defaultSource:this.id,defaultScope:a.DEFAULT_SCOPE}),i=this.#t.getExtractorConfigs().find(e=>{const o=a.parseFactRef(a.getFactRef(this.id,e));return r.source===o.source&&r.name===o.name});if(i)return this.#e.getDataSchema(i)}async getConfig(){return this.#t.getConfig()}async setConfig(t){this.#t.setConfig(t)}async getConfigSchema(){return JSON.stringify(B.default(R.GithubFactCollectorSchema))}}exports.GithubFactCollector=u;
2
2
  //# sourceMappingURL=GithubFactCollector.cjs.js.map
@@ -0,0 +1,2 @@
1
+ "use strict";var w=require("@spotify/backstage-plugin-soundcheck-common"),n=require("./helper/util.cjs.js"),y=require("./schema/branch_rules.json.cjs.js"),E=require("./utils.cjs.js");class c{static TYPE="BranchRules";#t;#e;#r;type=c.TYPE;static factory=({logger:r,cache:a,branchHelper:e})=>{const s=new c(r,a,e);return{predicate:o=>o.type===s.type,extractor:s}};constructor(r,a,e){this.#t=r,this.#e=a,this.#r=e}async extract(r,a,e,s,o){const h=[],g={owner:e.owner,repo:e.name,branch:await this.#a(a,e,s)},f=100;let p=0,i=!0;for(;i;){const u=`github:branch_rules:${e.owner}:${e.name}:${a}:${++p}`;try{const t=await s.rest.repos.getBranchRules({...g,per_page:f,page:p,headers:o?void 0:await E.getCacheHeader(this.#e,u)});t.headers?.link?.includes('rel="next"')||(i=!1),await this.#e.set(u,{etag:t.headers?.etag,lastModified:t.headers?.date,hasNext:i,data:t.data}),h.push(...t.data)}catch(t){if(n.isNotModifiedError(t)){const l=await this.#e.get(u);if(l){h.push(...l.data),i=l.hasNext;continue}else return}if(n.isNotFoundError(t))return{rules:[]};const d=`[BranchRules] fact extraction failed with: ${n.buildOctokitErrorMessage(t)}. Request parameters: ${JSON.stringify(g)}`;throw n.handleRateLimitError(t,d),this.#t.error(d),new Error(d)}}return{rules:h}}async#a(r,a,e){return r!==w.DEFAULT_SCOPE?r:this.#r.getDefaultBranch(a,e)}getDataSchema(r){return JSON.stringify(y.default)}}exports.BranchRulesFactExtractor=c;
2
+ //# sourceMappingURL=BranchRulesFactExtractor.cjs.js.map
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("@spotify/backstage-plugin-soundcheck-common"),t=require("zod");const c=e.BaseFactExtractorSchema.merge(t.z.strictObject({type:t.z.literal("BranchProtections"),branch:t.z.string().min(1).optional()})).strict(),r=e.BaseFactExtractorSchema.merge(t.z.strictObject({type:t.z.literal("RepositoryDetails")})).strict(),a=e.BaseFactExtractorSchema.merge(t.z.strictObject({type:t.z.literal("RepositoryLanguages")})).strict(),i=t.z.union([c,r,a]),o=e.buildFactCollectorSchema(i);exports.GithubFactCollectorSchema=o;
1
+ "use strict";var e=require("@spotify/backstage-plugin-soundcheck-common"),t=require("zod");const c=e.BaseFactExtractorSchema.merge(t.z.strictObject({type:t.z.literal("BranchProtections"),branch:t.z.string().min(1).optional()})).strict(),r=e.BaseFactExtractorSchema.merge(t.z.strictObject({type:t.z.literal("BranchRules"),branch:t.z.string().min(1).optional()})).strict(),a=e.BaseFactExtractorSchema.merge(t.z.strictObject({type:t.z.literal("RepositoryDetails")})).strict(),i=e.BaseFactExtractorSchema.merge(t.z.strictObject({type:t.z.literal("RepositoryLanguages")})).strict(),o=t.z.union([c,r,a,i]),s=e.buildFactCollectorSchema(o);exports.GithubFactCollectorSchema=s;
2
2
  //# sourceMappingURL=GithubFactCollectorSchema.cjs.js.map
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e="Repository Rule",t="A repository rule with ruleset details.",r="object",i={rules:{type:"array",items:{type:"object",oneOf:[{allOf:[{title:"creation",description:"Only allow users with bypass permission to create matching refs.",type:"object",required:["type"],properties:{type:{type:"string",enum:["creation"]}}},{title:"repository ruleset data for rule",description:"User-defined metadata to store domain-specific information limited to 8 keys with scalar values.",type:"object",properties:{ruleset_source_type:{type:"string",description:"The type of source for the ruleset that includes this rule.",enum:["Repository","Organization"]},ruleset_source:{type:"string",description:"The name of the source of the ruleset that includes this rule."},ruleset_id:{type:"integer",description:"The ID of the ruleset that includes this rule."}}}]},{allOf:[{title:"update",description:"Only allow users with bypass permission to update matching refs.",type:"object",required:["type"],properties:{type:{type:"string",enum:["update"]},parameters:{type:"object",properties:{update_allows_fetch_and_merge:{type:"boolean",description:"Branch can pull changes from its upstream repository"}},required:["update_allows_fetch_and_merge"]}}},{title:"repository ruleset data for rule",description:"User-defined metadata to store domain-specific information limited to 8 keys with scalar values.",type:"object",properties:{ruleset_source_type:{type:"string",description:"The type of source for the ruleset that includes this rule.",enum:["Repository","Organization"]},ruleset_source:{type:"string",description:"The name of the source of the ruleset that includes this rule."},ruleset_id:{type:"integer",description:"The ID of the ruleset that includes this rule."}}}]},{allOf:[{title:"deletion",description:"Only allow users with bypass permissions to delete matching refs.",type:"object",required:["type"],properties:{type:{type:"string",enum:["deletion"]}}},{title:"repository ruleset data for rule",description:"User-defined metadata to store domain-specific information limited to 8 keys with scalar values.",type:"object",properties:{ruleset_source_type:{type:"string",description:"The type of source for the ruleset that includes this rule.",enum:["Repository","Organization"]},ruleset_source:{type:"string",description:"The name of the source of the ruleset that includes this rule."},ruleset_id:{type:"integer",description:"The ID of the ruleset that includes this rule."}}}]},{allOf:[{title:"required_linear_history",description:"Prevent merge commits from being pushed to matching refs.",type:"object",required:["type"],properties:{type:{type:"string",enum:["required_linear_history"]}}},{title:"repository ruleset data for rule",description:"User-defined metadata to store domain-specific information limited to 8 keys with scalar values.",type:"object",properties:{ruleset_source_type:{type:"string",description:"The type of source for the ruleset that includes this rule.",enum:["Repository","Organization"]},ruleset_source:{type:"string",description:"The name of the source of the ruleset that includes this rule."},ruleset_id:{type:"integer",description:"The ID of the ruleset that includes this rule."}}}]},{allOf:[{title:"merge_queue",description:"Merges must be performed via a merge queue.",type:"object",required:["type"],properties:{type:{type:"string",enum:["merge_queue"]},parameters:{type:"object",properties:{check_response_timeout_minutes:{type:"integer",description:"Maximum time for a required status check to report a conclusion. After this much time has elapsed, checks that have not reported a conclusion will be assumed to have failed",minimum:1,maximum:360},grouping_strategy:{type:"string",description:"When set to ALLGREEN, the merge commit created by merge queue for each PR in the group must pass all required checks to merge. When set to HEADGREEN, only the commit at the head of the merge group, i.e. the commit containing changes from all of the PRs in the group, must pass its required checks to merge.",enum:["ALLGREEN","HEADGREEN"]},max_entries_to_build:{type:"integer",description:"Limit the number of queued pull requests requesting checks and workflow runs at the same time.",minimum:0,maximum:100},max_entries_to_merge:{type:"integer",description:"The maximum number of PRs that will be merged together in a group.",minimum:0,maximum:100},merge_method:{type:"string",description:"Method to use when merging changes from queued pull requests.",enum:["MERGE","SQUASH","REBASE"]},min_entries_to_merge:{type:"integer",description:"The minimum number of PRs that will be merged together in a group.",minimum:0,maximum:100},min_entries_to_merge_wait_minutes:{type:"integer",description:"The time merge queue should wait after the first PR is added to the queue for the minimum group size to be met. After this time has elapsed, the minimum group size will be ignored and a smaller group will be merged.",minimum:0,maximum:360}},required:["check_response_timeout_minutes","grouping_strategy","max_entries_to_build","max_entries_to_merge","merge_method","min_entries_to_merge","min_entries_to_merge_wait_minutes"]}}},{title:"repository ruleset data for rule",description:"User-defined metadata to store domain-specific information limited to 8 keys with scalar values.",type:"object",properties:{ruleset_source_type:{type:"string",description:"The type of source for the ruleset that includes this rule.",enum:["Repository","Organization"]},ruleset_source:{type:"string",description:"The name of the source of the ruleset that includes this rule."},ruleset_id:{type:"integer",description:"The ID of the ruleset that includes this rule."}}}]},{allOf:[{title:"required_deployments",description:"Choose which environments must be successfully deployed to before refs can be pushed into a ref that matches this rule.",type:"object",required:["type"],properties:{type:{type:"string",enum:["required_deployments"]},parameters:{type:"object",properties:{required_deployment_environments:{type:"array",description:"The environments that must be successfully deployed to before branches can be merged.",items:{type:"string"}}},required:["required_deployment_environments"]}}},{title:"repository ruleset data for rule",description:"User-defined metadata to store domain-specific information limited to 8 keys with scalar values.",type:"object",properties:{ruleset_source_type:{type:"string",description:"The type of source for the ruleset that includes this rule.",enum:["Repository","Organization"]},ruleset_source:{type:"string",description:"The name of the source of the ruleset that includes this rule."},ruleset_id:{type:"integer",description:"The ID of the ruleset that includes this rule."}}}]},{allOf:[{title:"required_signatures",description:"Commits pushed to matching refs must have verified signatures.",type:"object",required:["type"],properties:{type:{type:"string",enum:["required_signatures"]}}},{title:"repository ruleset data for rule",description:"User-defined metadata to store domain-specific information limited to 8 keys with scalar values.",type:"object",properties:{ruleset_source_type:{type:"string",description:"The type of source for the ruleset that includes this rule.",enum:["Repository","Organization"]},ruleset_source:{type:"string",description:"The name of the source of the ruleset that includes this rule."},ruleset_id:{type:"integer",description:"The ID of the ruleset that includes this rule."}}}]},{allOf:[{title:"pull_request",description:"Require all commits be made to a non-target branch and submitted via a pull request before they can be merged.",type:"object",required:["type"],properties:{type:{type:"string",enum:["pull_request"]},parameters:{type:"object",properties:{dismiss_stale_reviews_on_push:{type:"boolean",description:"New, reviewable commits pushed will dismiss previous pull request review approvals."},require_code_owner_review:{type:"boolean",description:"Require an approving review in pull requests that modify files that have a designated code owner."},require_last_push_approval:{type:"boolean",description:"Whether the most recent reviewable push must be approved by someone other than the person who pushed it."},required_approving_review_count:{type:"integer",description:"The number of approving reviews that are required before a pull request can be merged.",minimum:0,maximum:10},required_review_thread_resolution:{type:"boolean",description:"All conversations on code must be resolved before a pull request can be merged."}},required:["dismiss_stale_reviews_on_push","require_code_owner_review","require_last_push_approval","required_approving_review_count","required_review_thread_resolution"]}}},{title:"repository ruleset data for rule",description:"User-defined metadata to store domain-specific information limited to 8 keys with scalar values.",type:"object",properties:{ruleset_source_type:{type:"string",description:"The type of source for the ruleset that includes this rule.",enum:["Repository","Organization"]},ruleset_source:{type:"string",description:"The name of the source of the ruleset that includes this rule."},ruleset_id:{type:"integer",description:"The ID of the ruleset that includes this rule."}}}]},{allOf:[{title:"required_status_checks",description:"Choose which status checks must pass before the ref is updated. When enabled, commits must first be pushed to another ref where the checks pass.",type:"object",required:["type"],properties:{type:{type:"string",enum:["required_status_checks"]},parameters:{type:"object",properties:{do_not_enforce_on_create:{type:"boolean",description:"Allow repositories and branches to be created if a check would otherwise prohibit it."},required_status_checks:{type:"array",description:"Status checks that are required.",items:{title:"StatusCheckConfiguration",description:"Required status check",type:"object",properties:{context:{type:"string",description:"The status check context name that must be present on the commit."},integration_id:{type:"integer",description:"The optional integration ID that this status check must originate from."}},required:["context"]}},strict_required_status_checks_policy:{type:"boolean",description:"Whether pull requests targeting a matching branch must be tested with the latest code. This setting will not take effect unless at least one status check is enabled."}},required:["required_status_checks","strict_required_status_checks_policy"]}}},{title:"repository ruleset data for rule",description:"User-defined metadata to store domain-specific information limited to 8 keys with scalar values.",type:"object",properties:{ruleset_source_type:{type:"string",description:"The type of source for the ruleset that includes this rule.",enum:["Repository","Organization"]},ruleset_source:{type:"string",description:"The name of the source of the ruleset that includes this rule."},ruleset_id:{type:"integer",description:"The ID of the ruleset that includes this rule."}}}]},{allOf:[{title:"non_fast_forward",description:"Prevent users with push access from force pushing to refs.",type:"object",required:["type"],properties:{type:{type:"string",enum:["non_fast_forward"]}}},{title:"repository ruleset data for rule",description:"User-defined metadata to store domain-specific information limited to 8 keys with scalar values.",type:"object",properties:{ruleset_source_type:{type:"string",description:"The type of source for the ruleset that includes this rule.",enum:["Repository","Organization"]},ruleset_source:{type:"string",description:"The name of the source of the ruleset that includes this rule."},ruleset_id:{type:"integer",description:"The ID of the ruleset that includes this rule."}}}]},{allOf:[{title:"commit_message_pattern",description:"Parameters to be used for the commit_message_pattern rule",type:"object",required:["type"],properties:{type:{type:"string",enum:["commit_message_pattern"]},parameters:{type:"object",properties:{name:{type:"string",description:"How this rule will appear to users."},negate:{type:"boolean",description:"If true, the rule will fail if the pattern matches."},operator:{type:"string",description:"The operator to use for matching.",enum:["starts_with","ends_with","contains","regex"]},pattern:{type:"string",description:"The pattern to match with."}},required:["operator","pattern"]}}},{title:"repository ruleset data for rule",description:"User-defined metadata to store domain-specific information limited to 8 keys with scalar values.",type:"object",properties:{ruleset_source_type:{type:"string",description:"The type of source for the ruleset that includes this rule.",enum:["Repository","Organization"]},ruleset_source:{type:"string",description:"The name of the source of the ruleset that includes this rule."},ruleset_id:{type:"integer",description:"The ID of the ruleset that includes this rule."}}}]},{allOf:[{title:"commit_author_email_pattern",description:"Parameters to be used for the commit_author_email_pattern rule",type:"object",required:["type"],properties:{type:{type:"string",enum:["commit_author_email_pattern"]},parameters:{type:"object",properties:{name:{type:"string",description:"How this rule will appear to users."},negate:{type:"boolean",description:"If true, the rule will fail if the pattern matches."},operator:{type:"string",description:"The operator to use for matching.",enum:["starts_with","ends_with","contains","regex"]},pattern:{type:"string",description:"The pattern to match with."}},required:["operator","pattern"]}}},{title:"repository ruleset data for rule",description:"User-defined metadata to store domain-specific information limited to 8 keys with scalar values.",type:"object",properties:{ruleset_source_type:{type:"string",description:"The type of source for the ruleset that includes this rule.",enum:["Repository","Organization"]},ruleset_source:{type:"string",description:"The name of the source of the ruleset that includes this rule."},ruleset_id:{type:"integer",description:"The ID of the ruleset that includes this rule."}}}]},{allOf:[{title:"committer_email_pattern",description:"Parameters to be used for the committer_email_pattern rule",type:"object",required:["type"],properties:{type:{type:"string",enum:["committer_email_pattern"]},parameters:{type:"object",properties:{name:{type:"string",description:"How this rule will appear to users."},negate:{type:"boolean",description:"If true, the rule will fail if the pattern matches."},operator:{type:"string",description:"The operator to use for matching.",enum:["starts_with","ends_with","contains","regex"]},pattern:{type:"string",description:"The pattern to match with."}},required:["operator","pattern"]}}},{title:"repository ruleset data for rule",description:"User-defined metadata to store domain-specific information limited to 8 keys with scalar values.",type:"object",properties:{ruleset_source_type:{type:"string",description:"The type of source for the ruleset that includes this rule.",enum:["Repository","Organization"]},ruleset_source:{type:"string",description:"The name of the source of the ruleset that includes this rule."},ruleset_id:{type:"integer",description:"The ID of the ruleset that includes this rule."}}}]},{allOf:[{title:"branch_name_pattern",description:"Parameters to be used for the branch_name_pattern rule",type:"object",required:["type"],properties:{type:{type:"string",enum:["branch_name_pattern"]},parameters:{type:"object",properties:{name:{type:"string",description:"How this rule will appear to users."},negate:{type:"boolean",description:"If true, the rule will fail if the pattern matches."},operator:{type:"string",description:"The operator to use for matching.",enum:["starts_with","ends_with","contains","regex"]},pattern:{type:"string",description:"The pattern to match with."}},required:["operator","pattern"]}}},{title:"repository ruleset data for rule",description:"User-defined metadata to store domain-specific information limited to 8 keys with scalar values.",type:"object",properties:{ruleset_source_type:{type:"string",description:"The type of source for the ruleset that includes this rule.",enum:["Repository","Organization"]},ruleset_source:{type:"string",description:"The name of the source of the ruleset that includes this rule."},ruleset_id:{type:"integer",description:"The ID of the ruleset that includes this rule."}}}]},{allOf:[{title:"tag_name_pattern",description:"Parameters to be used for the tag_name_pattern rule",type:"object",required:["type"],properties:{type:{type:"string",enum:["tag_name_pattern"]},parameters:{type:"object",properties:{name:{type:"string",description:"How this rule will appear to users."},negate:{type:"boolean",description:"If true, the rule will fail if the pattern matches."},operator:{type:"string",description:"The operator to use for matching.",enum:["starts_with","ends_with","contains","regex"]},pattern:{type:"string",description:"The pattern to match with."}},required:["operator","pattern"]}}},{title:"repository ruleset data for rule",description:"User-defined metadata to store domain-specific information limited to 8 keys with scalar values.",type:"object",properties:{ruleset_source_type:{type:"string",description:"The type of source for the ruleset that includes this rule.",enum:["Repository","Organization"]},ruleset_source:{type:"string",description:"The name of the source of the ruleset that includes this rule."},ruleset_id:{type:"integer",description:"The ID of the ruleset that includes this rule."}}}]},{allOf:[{title:"workflows",description:"Require all changes made to a targeted branch to pass the specified workflows before they can be merged.",type:"object",required:["type"],properties:{type:{type:"string",enum:["workflows"]},parameters:{type:"object",properties:{do_not_enforce_on_create:{type:"boolean",description:"Allow repositories and branches to be created if a check would otherwise prohibit it."},workflows:{type:"array",description:"Workflows that must pass for this rule to pass.",items:{title:"WorkflowFileReference",description:"A workflow that must run for this rule to pass",type:"object",properties:{path:{type:"string",description:"The path to the workflow file"},ref:{type:"string",description:"The ref (branch or tag) of the workflow file to use"},repository_id:{type:"integer",description:"The ID of the repository where the workflow is defined"},sha:{type:"string",description:"The commit SHA of the workflow file to use"}},required:["path","repository_id"]}}},required:["workflows"]}}},{title:"repository ruleset data for rule",description:"User-defined metadata to store domain-specific information limited to 8 keys with scalar values.",type:"object",properties:{ruleset_source_type:{type:"string",description:"The type of source for the ruleset that includes this rule.",enum:["Repository","Organization"]},ruleset_source:{type:"string",description:"The name of the source of the ruleset that includes this rule."},ruleset_id:{type:"integer",description:"The ID of the ruleset that includes this rule."}}}]},{allOf:[{title:"code_scanning",description:"Choose which tools must provide code scanning results before the reference is updated. When configured, code scanning must be enabled and have results for both the commit and the reference being updated.",type:"object",required:["type"],properties:{type:{type:"string",enum:["code_scanning"]},parameters:{type:"object",properties:{code_scanning_tools:{type:"array",description:"Tools that must provide code scanning results for this rule to pass.",items:{title:"CodeScanningTool",description:"A tool that must provide code scanning results for this rule to pass.",type:"object",properties:{alerts_threshold:{type:"string",description:'The severity level at which code scanning results that raise alerts block a reference update. For more information on alert severity levels, see "[About code scanning alerts](https://docs.github.com/code-security/code-scanning/managing-code-scanning-alerts/about-code-scanning-alerts#about-alert-severity-and-security-severity-levels)."',enum:["none","errors","errors_and_warnings","all"]},security_alerts_threshold:{type:"string",description:'The severity level at which code scanning results that raise security alerts block a reference update. For more information on security severity levels, see "[About code scanning alerts](https://docs.github.com/code-security/code-scanning/managing-code-scanning-alerts/about-code-scanning-alerts#about-alert-severity-and-security-severity-levels)."',enum:["none","critical","high_or_higher","medium_or_higher","all"]},tool:{type:"string",description:"The name of a code scanning tool"}},required:["alerts_threshold","security_alerts_threshold","tool"]}}},required:["code_scanning_tools"]}}},{title:"repository ruleset data for rule",description:"User-defined metadata to store domain-specific information limited to 8 keys with scalar values.",type:"object",properties:{ruleset_source_type:{type:"string",description:"The type of source for the ruleset that includes this rule.",enum:["Repository","Organization"]},ruleset_source:{type:"string",description:"The name of the source of the ruleset that includes this rule."},ruleset_id:{type:"integer",description:"The ID of the ruleset that includes this rule."}}}]}]}}},s={title:e,description:t,type:r,properties:i};exports.default=s,exports.description=t,exports.properties=i,exports.title=e,exports.type=r;
2
+ //# sourceMappingURL=branch_rules.json.cjs.js.map
package/dist/index.d.ts CHANGED
@@ -11,9 +11,6 @@ import * as _backstage_backend_plugin_api from '@backstage/backend-plugin-api';
11
11
  * Soundcheck 3rd party integration - Github.
12
12
  *
13
13
  * @public
14
- * @deprecated This will be removed in an upcoming release. Use the default
15
- * export from this package in combination with the "New" Backstage Backend
16
- * system instead.
17
14
  */
18
15
  declare class GithubFactCollector implements ConfigurableFactCollector {
19
16
  #private;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@spotify/backstage-plugin-soundcheck-backend-module-github",
3
3
  "description": "Soundcheck 3rd party integration with Github",
4
- "version": "0.6.5",
4
+ "version": "0.6.6",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "homepage": "https://backstage.spotify.com",
7
7
  "main": "dist/index.cjs.js",
@@ -24,25 +24,25 @@
24
24
  "postpack": "backstage-cli package postpack"
25
25
  },
26
26
  "devDependencies": {
27
- "@backstage/backend-test-utils": "^1.1.0",
28
- "@backstage/cli": "^0.29.2",
29
- "@spotify/backstage-plugin-soundcheck-backend": "^0.17.8",
27
+ "@backstage/backend-test-utils": "^1.2.0",
28
+ "@backstage/cli": "^0.29.4",
29
+ "@spotify/backstage-plugin-soundcheck-backend": "^0.17.10",
30
30
  "@types/git-url-parse": "^9.0.0",
31
31
  "@types/luxon": "^3.0.1",
32
32
  "supertest": "^7.0.0"
33
33
  },
34
34
  "dependencies": {
35
35
  "@backstage/backend-common": "^0.25.0",
36
- "@backstage/backend-plugin-api": "^1.0.2",
37
- "@backstage/catalog-model": "^1.7.1",
38
- "@backstage/config": "^1.3.0",
39
- "@backstage/errors": "^1.2.5",
40
- "@backstage/integration": "^1.15.2",
36
+ "@backstage/backend-plugin-api": "^1.1.0",
37
+ "@backstage/catalog-model": "^1.7.2",
38
+ "@backstage/config": "^1.3.1",
39
+ "@backstage/errors": "^1.2.6",
40
+ "@backstage/integration": "^1.16.0",
41
41
  "@backstage/types": "^1.2.0",
42
42
  "@octokit/request-error": "^5.0.0",
43
43
  "@octokit/rest": "^20.0.0",
44
- "@spotify/backstage-plugin-soundcheck-common": "^0.14.4",
45
- "@spotify/backstage-plugin-soundcheck-node": "^0.8.5",
44
+ "@spotify/backstage-plugin-soundcheck-common": "^0.14.5",
45
+ "@spotify/backstage-plugin-soundcheck-node": "^0.8.6",
46
46
  "git-url-parse": "^16.0.0",
47
47
  "lodash": "^4.17.21",
48
48
  "luxon": "^3.1.1",