Skip to content

Instantly share code, notes, and snippets.

View taras's full-sized avatar

Taras Mankovski taras

View GitHub Profile
openapi: 3.0.3
info:
title: 'backstage-plugin-changes-backend'
version: '1'
description: The Backstage backend plugin that provides the Changes API
contact: {}
servers:
- url: /
- url: changes
components:
openapi: 3.0.3
info:
title: 'backstage-plugin-changes-backend'
version: '1'
description: The Backstage backend plugin that provides the Changes API
contact: {}
servers:
- url: /
- url: changes
components:
import axios, { AxiosInstance } from 'axios';
import dotenv from 'dotenv';
import {
IncrementalEntityProvider,
EntityIteratorResult,
} from '@backstage/plugin-catalog-backend-module-incremental-ingestion';
dotenv.config();
interface BitbucketApiResponse {
function useComposer() {
const github = // useApi(Scm)
const token = github.token
return {
async getRepositories() {
return fetch(.../repositoriess)
},
async getFeatures() {
return fetch(.../features)
import fs from 'fs/promises';
import path from 'path';
import { findPaths } from '@backstage/cli-common';
import { Command } from 'commander';
import { loadConfig, loadConfigSchema } from '@backstage/config-loader';
import { getPackages } from '@manypkg/get-packages';
import { ConfigReader } from '@backstage/config';
async function inject() {
const config = await readConfig(process.argv);
import { findPaths } from '@backstage/cli-common';
import { Command } from 'commander';
import { loadConfig, loadConfigSchema } from '@backstage/config-loader';
import { getPackages } from '@manypkg/get-packages';
import { ConfigReader, Config } from '@backstage/config';
export async function readConfig(argv: NodeJS.Process['argv']) {
const program = new Command();
program.option('--config <path>', 'Config files to load instead of app-config.yaml', []);
catalog:
<AboutCard>:
$import:
- names: [<AboutCard>]
from: ./catalog.yaml
- names: [<Alarm>]
from: ./icons.yaml
$do:
$<AboutCard>:
secondaryButtons(_):
@taras
taras / environments-view.graphql
Last active October 14, 2022 17:40
Examples of using GraphQL Schema and Operations to define CLI from the server
query EnvironmentsView($cursor: String) {
@table
environments(first: 10, after: $cursor) {
nodes {
... on Environment {
name
namespace
deployment {
name
createdBy
query AllOrganizations($organization: String!, $endCursor: String) {
organizations(first: 100, after: $organization) {
pageInfo {
hasNextPage
endCursor
}
nodes {
... OrganizationNode
... on Organization {
repositories(first: 100, after: $endCursor) {
{
"data": {
"meta": [
{
"name": "Component",
"count": 1,
"vertices": {
"owner": {
"name": "Group",
"field": "owner",