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 7.2.0 bugs to make it compatible with mta-cli #754

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows /ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Basic CI

on:
push:
branches:
- "7.2.0" # Trigger only on pushes to the master branch

pull_request:
branches:
- "7.2.0" # Trigger on pull requests targeting the master branch

jobs:
test:
name: Run Tests
runs-on: ubuntu-latest # Use Ubuntu for the runner

steps:
# Step 1: Checkout the code
- name: Checkout code
uses: actions/checkout@v4

# Step 2: Set up Node.js
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "16" # Specify the Node.js version

# Step 3: Install dependencies
- name: Install dependencies
run: npm install

# Step 4: Compile the project
- name: Compile the project
run: npm run compile
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "mta-vscode-extension",
"displayName": "Migration Toolkit for Applications (MTA)",
"description": "Migration Toolkit for Applications (MTA)",
"version": "7.1.1",
"version": "7.2.0",
"license": "epl-2.0",
"publisher": "redhat",
"author": "Red Hat",
Expand Down
3 changes: 2 additions & 1 deletion resources/help.json
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@
"description": "The location of the generated analysis results.",
"type": "String",
"ui-type": ["single"],
"required": false
"required": true,
"editable": false
},
{
"name": "analyze-known-libraries",
Expand Down
5 changes: 3 additions & 2 deletions src/editor/configurationView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,9 @@ export class ConfigurationView {

// cloning...
if (cloning) {
if (vscode.workspace.workspaceFolders) {
const workspaceFolder = vscode.workspace.workspaceFolders[0].uri.fsPath;
if (this.configuration.getinput()) {
const inputPaths = this.configuration.getinput();
const workspaceFolder = vscode.Uri.joinPath(vscode.Uri.file(inputPaths[0])).fsPath;
const folderName = data.value.substring(data.value.lastIndexOf('/') + 1);
const cloneCommand = {repo: data.value, folderName, config: this.configuration, workspaceFolder};
vscode.commands.executeCommand('rhamt.downloadGitRepo', cloneCommand).then((result:any) => {
Expand Down
7 changes: 5 additions & 2 deletions src/server/analyzerModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,12 @@ export class RhamtConfiguration {
}

sourceBase(): string {
return 'file:///tmp/source-code/';
return 'file:///opt/input/source';
}
getinput(): string {
if (!this.options['input']) return undefined;
return this.options['input'];
}

getResultsLocation(): string {
if (!this.options['output']) return undefined;
return path.resolve(this.options['output'], 'results.xml');
Expand Down
11 changes: 9 additions & 2 deletions src/server/analyzerResults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,15 @@ export class AnalyzerResults {
if (incidents) {
incidents.forEach(incident => {
const file = (incident.uri as string).replace(this.config.sourceBase(), '');
const root = vscode.workspace.workspaceFolders[0];
const fileUri = vscode.Uri.joinPath(root.uri, file);
const root = vscode.workspace.workspaceFolders?.[0];
let fileUri: vscode.Uri;
const inputPaths = this.config.getinput();
if (Array.isArray(inputPaths) && inputPaths[0]) {
fileUri = vscode.Uri.joinPath(vscode.Uri.file(inputPaths[0]), file);
} else if (root) {
fileUri = vscode.Uri.joinPath(root.uri, file);
}

try {
const hint = {
type: IIssueType.Hint,
Expand Down
12 changes: 7 additions & 5 deletions src/tree/configurationNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,18 +131,20 @@ export class ConfigurationNode extends AbstractNode<ConfigurationItem> implement
}

private buildResourceNodes(file: string): void {
const root = workspace.workspaceFolders[0];
const inputPaths = this.config.getinput();
const root = Uri.file(inputPaths[0]);
// const root = workspace.workspaceFolders[0];

if (!this.childNodes.has(root.uri.fsPath)) {
if (!this.childNodes.has(root.fsPath)) {
const folder = new FolderNode(
this.config,
root.uri.fsPath,
root.fsPath,
this.modelService,
this.onNodeCreateEmitter,
this.dataProvider,
this);
this.childNodes.set(root.uri.fsPath, folder);
this.resourceNodes.set(root.uri.fsPath, folder);
this.childNodes.set(root.fsPath, folder);
this.resourceNodes.set(root.fsPath, folder);
}


Expand Down